@apipass/pipes 0.1.1 → 0.1.5-alpha.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/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 -14
- package/public-api.d.ts +5 -5
- package/apipass-pipes.metadata.json +0 -1
package/apipass-pipes.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
/// <amd-module name="@apipass/pipes" />
|
|
5
|
+
export * from './public-api';
|
package/assets/css/colors.scss
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--color-primary: #222D57;
|
|
3
|
-
--color-primary-hover: #18203D;
|
|
4
|
-
--color-primary-active: #29376A;
|
|
5
|
-
|
|
6
|
-
--color-secondary: #D3D921;
|
|
7
|
-
--color-secondary-hover: #B3B81C;
|
|
8
|
-
--color-secondary-active: #DCE13F;
|
|
9
|
-
|
|
10
|
-
--color-tertiary: #EFEFEF;
|
|
11
|
-
--color-tertiary-hover: #CBCBCB;
|
|
12
|
-
--color-tertiary-active: #F1F1F1;
|
|
13
|
-
|
|
14
|
-
--color-fonts-tertiary: #777777;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// Defaults
|
|
20
|
-
--color-body-light: #FFF;
|
|
21
|
-
--color-red: rgb(255, 0, 0);
|
|
22
|
-
--limit-plan-color: #ff6c00;
|
|
23
|
-
--color_disabled: #E0E0E0;
|
|
24
|
-
--color_components_light: #FFF;
|
|
25
|
-
--color-inputs-border: #DDD;
|
|
26
|
-
--color-inputs-background: #FFF;
|
|
27
|
-
--color_icon_remove: var(--color-red);
|
|
28
|
-
--color_icon_success: #070;
|
|
29
|
-
--color_graph_primary: #1643EF;
|
|
30
|
-
--color_graph_primary_hover: #0A2692;
|
|
31
|
-
--color_graph_error: #EB5757;
|
|
32
|
-
--color_graph_error_hover: #C91717;
|
|
33
|
-
|
|
34
|
-
}
|
|
1
|
+
:root {
|
|
2
|
+
--color-primary: #222D57;
|
|
3
|
+
--color-primary-hover: #18203D;
|
|
4
|
+
--color-primary-active: #29376A;
|
|
5
|
+
|
|
6
|
+
--color-secondary: #D3D921;
|
|
7
|
+
--color-secondary-hover: #B3B81C;
|
|
8
|
+
--color-secondary-active: #DCE13F;
|
|
9
|
+
|
|
10
|
+
--color-tertiary: #EFEFEF;
|
|
11
|
+
--color-tertiary-hover: #CBCBCB;
|
|
12
|
+
--color-tertiary-active: #F1F1F1;
|
|
13
|
+
|
|
14
|
+
--color-fonts-tertiary: #777777;
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
// Defaults
|
|
20
|
+
--color-body-light: #FFF;
|
|
21
|
+
--color-red: rgb(255, 0, 0);
|
|
22
|
+
--limit-plan-color: #ff6c00;
|
|
23
|
+
--color_disabled: #E0E0E0;
|
|
24
|
+
--color_components_light: #FFF;
|
|
25
|
+
--color-inputs-border: #DDD;
|
|
26
|
+
--color-inputs-background: #FFF;
|
|
27
|
+
--color_icon_remove: var(--color-red);
|
|
28
|
+
--color_icon_success: #070;
|
|
29
|
+
--color_graph_primary: #1643EF;
|
|
30
|
+
--color_graph_primary_hover: #0A2692;
|
|
31
|
+
--color_graph_error: #EB5757;
|
|
32
|
+
--color_graph_error_hover: #C91717;
|
|
33
|
+
|
|
34
|
+
}
|
package/assets/css/icons.scss
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
@import "colors";
|
|
2
|
-
|
|
3
|
-
/* Icons */
|
|
4
|
-
.apipass-icon-primary {
|
|
5
|
-
color: var(--color-primary);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.apipass-icon-secondary {
|
|
9
|
-
color: var(--color-secondary);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.apipass-icon-tertiary {
|
|
13
|
-
color: var(--color-fonts-tertiary);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.apipass-icon-remove {
|
|
17
|
-
color: var(--color_icon_remove);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.apipass-icon-success {
|
|
21
|
-
color: var(--color_icon_success);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.apipass-icon-white {
|
|
25
|
-
color: #FFF;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.apipass-icon-white-active {
|
|
29
|
-
color: var(--color-secondary);
|
|
30
|
-
}
|
|
1
|
+
@import "colors";
|
|
2
|
+
|
|
3
|
+
/* Icons */
|
|
4
|
+
.apipass-icon-primary {
|
|
5
|
+
color: var(--color-primary);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.apipass-icon-secondary {
|
|
9
|
+
color: var(--color-secondary);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.apipass-icon-tertiary {
|
|
13
|
+
color: var(--color-fonts-tertiary);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.apipass-icon-remove {
|
|
17
|
+
color: var(--color_icon_remove);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.apipass-icon-success {
|
|
21
|
+
color: var(--color_icon_success);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.apipass-icon-white {
|
|
25
|
+
color: #FFF;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.apipass-icon-white-active {
|
|
29
|
+
color: var(--color-secondary);
|
|
30
|
+
}
|
|
@@ -1,142 +1,167 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ngx-translate/core'), require('rxjs/internal-compatibility'), require('@angular/platform-browser')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define('@apipass/pipes', ['exports', '@angular/core', '@ngx-translate/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.
|
|
5
|
-
}(this, (function (exports,
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.apipass = global.apipass || {}, global.apipass.pipes = {}), global.ng.core, global.i1, global.rxjs['internal-compatibility'], global.ng.platformBrowser));
|
|
5
|
+
}(this, (function (exports, i0, i1, internalCompatibility, i1$1) { 'use strict';
|
|
6
6
|
|
|
7
|
-
var SelectFilterPipe = /** @class */ (function () {
|
|
8
|
-
function SelectFilterPipe(translate) {
|
|
9
|
-
this.translate = translate;
|
|
10
|
-
}
|
|
11
|
-
SelectFilterPipe.prototype.transform = function (items, arg1, arg2) {
|
|
12
|
-
var searchText = arg1;
|
|
13
|
-
var termName = arg2;
|
|
14
|
-
if (!searchText) {
|
|
15
|
-
return items;
|
|
16
|
-
}
|
|
17
|
-
searchText = searchText.toLowerCase();
|
|
18
|
-
return items.filter(function (item) {
|
|
19
|
-
return item[termName].toLowerCase().indexOf(searchText) > -1;
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
return SelectFilterPipe;
|
|
23
|
-
}());
|
|
24
|
-
SelectFilterPipe
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
7
|
+
var SelectFilterPipe = /** @class */ (function () {
|
|
8
|
+
function SelectFilterPipe(translate) {
|
|
9
|
+
this.translate = translate;
|
|
10
|
+
}
|
|
11
|
+
SelectFilterPipe.prototype.transform = function (items, arg1, arg2) {
|
|
12
|
+
var searchText = arg1;
|
|
13
|
+
var termName = arg2;
|
|
14
|
+
if (!searchText) {
|
|
15
|
+
return items;
|
|
16
|
+
}
|
|
17
|
+
searchText = searchText.toLowerCase();
|
|
18
|
+
return items.filter(function (item) {
|
|
19
|
+
return item[termName].toLowerCase().indexOf(searchText) > -1;
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
return SelectFilterPipe;
|
|
23
|
+
}());
|
|
24
|
+
SelectFilterPipe.ɵfac = function SelectFilterPipe_Factory(t) { return new (t || SelectFilterPipe)(i0.ɵɵdirectiveInject(i1.TranslateService)); };
|
|
25
|
+
SelectFilterPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "selectFilter", type: SelectFilterPipe, pure: true });
|
|
26
|
+
/*@__PURE__*/ (function () {
|
|
27
|
+
i0.ɵsetClassMetadata(SelectFilterPipe, [{
|
|
28
|
+
type: i0.Pipe,
|
|
29
|
+
args: [{ name: 'selectFilter' }]
|
|
30
|
+
}], function () { return [{ type: i1.TranslateService }]; }, null);
|
|
31
|
+
})();
|
|
30
32
|
|
|
31
|
-
var SelectEnumFilterPipe = /** @class */ (function () {
|
|
32
|
-
function SelectEnumFilterPipe(translate) {
|
|
33
|
-
this.translate = translate;
|
|
34
|
-
}
|
|
35
|
-
SelectEnumFilterPipe.prototype.transform = function (items, arg1) {
|
|
36
|
-
var _this = this;
|
|
37
|
-
var searchText = arg1;
|
|
38
|
-
if (!searchText) {
|
|
39
|
-
return items;
|
|
40
|
-
}
|
|
41
|
-
searchText = searchText.toLowerCase();
|
|
42
|
-
return items.filter(function (item) {
|
|
43
|
-
var enumValue = _this.translate.instant(item.value);
|
|
44
|
-
return enumValue.toLowerCase().indexOf(searchText) > -1;
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
return SelectEnumFilterPipe;
|
|
48
|
-
}());
|
|
49
|
-
SelectEnumFilterPipe
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
33
|
+
var SelectEnumFilterPipe = /** @class */ (function () {
|
|
34
|
+
function SelectEnumFilterPipe(translate) {
|
|
35
|
+
this.translate = translate;
|
|
36
|
+
}
|
|
37
|
+
SelectEnumFilterPipe.prototype.transform = function (items, arg1) {
|
|
38
|
+
var _this = this;
|
|
39
|
+
var searchText = arg1;
|
|
40
|
+
if (!searchText) {
|
|
41
|
+
return items;
|
|
42
|
+
}
|
|
43
|
+
searchText = searchText.toLowerCase();
|
|
44
|
+
return items.filter(function (item) {
|
|
45
|
+
var enumValue = _this.translate.instant(item.value);
|
|
46
|
+
return enumValue.toLowerCase().indexOf(searchText) > -1;
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
return SelectEnumFilterPipe;
|
|
50
|
+
}());
|
|
51
|
+
SelectEnumFilterPipe.ɵfac = function SelectEnumFilterPipe_Factory(t) { return new (t || SelectEnumFilterPipe)(i0.ɵɵdirectiveInject(i1.TranslateService)); };
|
|
52
|
+
SelectEnumFilterPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "selectEnumFilter", type: SelectEnumFilterPipe, pure: true });
|
|
53
|
+
/*@__PURE__*/ (function () {
|
|
54
|
+
i0.ɵsetClassMetadata(SelectEnumFilterPipe, [{
|
|
55
|
+
type: i0.Pipe,
|
|
56
|
+
args: [{ name: 'selectEnumFilter' }]
|
|
57
|
+
}], function () { return [{ type: i1.TranslateService }]; }, null);
|
|
58
|
+
})();
|
|
55
59
|
|
|
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
|
|
82
|
-
|
|
83
|
-
|
|
60
|
+
var EnumPipe = /** @class */ (function () {
|
|
61
|
+
function EnumPipe() {
|
|
62
|
+
}
|
|
63
|
+
EnumPipe.prototype.transform = function (value, exception) {
|
|
64
|
+
var keys = [];
|
|
65
|
+
var add = true;
|
|
66
|
+
for (var enumMember in value) {
|
|
67
|
+
if (!value.hasOwnProperty(enumMember)) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (add && !this.isException(value[enumMember], exception)) {
|
|
71
|
+
keys.push({ key: enumMember, value: value[enumMember] });
|
|
72
|
+
}
|
|
73
|
+
add = !add;
|
|
74
|
+
}
|
|
75
|
+
return keys;
|
|
76
|
+
};
|
|
77
|
+
EnumPipe.prototype.isException = function (enumValue, exception) {
|
|
78
|
+
if (exception && internalCompatibility.isArray(exception)) {
|
|
79
|
+
return exception.some(function (exceptionValue) { return enumValue === exceptionValue; });
|
|
80
|
+
}
|
|
81
|
+
return exception ? enumValue === exception : false;
|
|
82
|
+
};
|
|
83
|
+
return EnumPipe;
|
|
84
|
+
}());
|
|
85
|
+
EnumPipe.ɵfac = function EnumPipe_Factory(t) { return new (t || EnumPipe)(); };
|
|
86
|
+
EnumPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "enum", type: EnumPipe, pure: true });
|
|
87
|
+
/*@__PURE__*/ (function () {
|
|
88
|
+
i0.ɵsetClassMetadata(EnumPipe, [{
|
|
89
|
+
type: i0.Pipe,
|
|
90
|
+
args: [{ name: 'enum' }]
|
|
91
|
+
}], null, null);
|
|
92
|
+
})();
|
|
84
93
|
|
|
85
|
-
var SafePipe = /** @class */ (function () {
|
|
86
|
-
function SafePipe(
|
|
87
|
-
this.
|
|
88
|
-
}
|
|
89
|
-
SafePipe.prototype.transform = function (value, type) {
|
|
90
|
-
switch (type) {
|
|
91
|
-
case 'html':
|
|
92
|
-
return this.
|
|
93
|
-
case 'style':
|
|
94
|
-
return this.
|
|
95
|
-
case 'script':
|
|
96
|
-
return this.
|
|
97
|
-
case 'url':
|
|
98
|
-
return this.
|
|
99
|
-
case 'resourceUrl':
|
|
100
|
-
return this.
|
|
101
|
-
default:
|
|
102
|
-
return this.
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
return SafePipe;
|
|
106
|
-
}());
|
|
107
|
-
SafePipe
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
94
|
+
var SafePipe = /** @class */ (function () {
|
|
95
|
+
function SafePipe(sanitizer) {
|
|
96
|
+
this.sanitizer = sanitizer;
|
|
97
|
+
}
|
|
98
|
+
SafePipe.prototype.transform = function (value, type) {
|
|
99
|
+
switch (type) {
|
|
100
|
+
case 'html':
|
|
101
|
+
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
102
|
+
case 'style':
|
|
103
|
+
return this.sanitizer.bypassSecurityTrustStyle(value);
|
|
104
|
+
case 'script':
|
|
105
|
+
return this.sanitizer.bypassSecurityTrustScript(value);
|
|
106
|
+
case 'url':
|
|
107
|
+
return this.sanitizer.bypassSecurityTrustUrl(value);
|
|
108
|
+
case 'resourceUrl':
|
|
109
|
+
return this.sanitizer.bypassSecurityTrustResourceUrl(value);
|
|
110
|
+
default:
|
|
111
|
+
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
return SafePipe;
|
|
115
|
+
}());
|
|
116
|
+
SafePipe.ɵfac = function SafePipe_Factory(t) { return new (t || SafePipe)(i0.ɵɵdirectiveInject(i1$1.DomSanitizer)); };
|
|
117
|
+
SafePipe.ɵpipe = i0.ɵɵdefinePipe({ name: "safe", type: SafePipe, pure: true });
|
|
118
|
+
/*@__PURE__*/ (function () {
|
|
119
|
+
i0.ɵsetClassMetadata(SafePipe, [{
|
|
120
|
+
type: i0.Pipe,
|
|
121
|
+
args: [{
|
|
122
|
+
name: 'safe'
|
|
123
|
+
}]
|
|
124
|
+
}], function () { return [{ type: i1$1.DomSanitizer }]; }, null);
|
|
125
|
+
})();
|
|
115
126
|
|
|
116
|
-
var PipeModule = /** @class */ (function () {
|
|
117
|
-
function PipeModule() {
|
|
118
|
-
}
|
|
119
|
-
return PipeModule;
|
|
120
|
-
}());
|
|
121
|
-
PipeModule
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
127
|
+
var PipeModule = /** @class */ (function () {
|
|
128
|
+
function PipeModule() {
|
|
129
|
+
}
|
|
130
|
+
return PipeModule;
|
|
131
|
+
}());
|
|
132
|
+
PipeModule.ɵmod = i0.ɵɵdefineNgModule({ type: PipeModule });
|
|
133
|
+
PipeModule.ɵinj = i0.ɵɵdefineInjector({ factory: function PipeModule_Factory(t) { return new (t || PipeModule)(); } });
|
|
134
|
+
(function () {
|
|
135
|
+
(typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(PipeModule, { declarations: [SelectFilterPipe,
|
|
136
|
+
SelectEnumFilterPipe,
|
|
137
|
+
EnumPipe,
|
|
138
|
+
SafePipe], exports: [SelectFilterPipe,
|
|
139
|
+
SelectEnumFilterPipe,
|
|
140
|
+
EnumPipe,
|
|
141
|
+
SafePipe] });
|
|
142
|
+
})();
|
|
143
|
+
/*@__PURE__*/ (function () {
|
|
144
|
+
i0.ɵsetClassMetadata(PipeModule, [{
|
|
145
|
+
type: i0.NgModule,
|
|
146
|
+
args: [{
|
|
147
|
+
declarations: [
|
|
148
|
+
SelectFilterPipe,
|
|
149
|
+
SelectEnumFilterPipe,
|
|
150
|
+
EnumPipe,
|
|
151
|
+
SafePipe
|
|
152
|
+
],
|
|
153
|
+
exports: [
|
|
154
|
+
SelectFilterPipe,
|
|
155
|
+
SelectEnumFilterPipe,
|
|
156
|
+
EnumPipe,
|
|
157
|
+
SafePipe
|
|
158
|
+
],
|
|
159
|
+
}]
|
|
160
|
+
}], null, null);
|
|
161
|
+
})();
|
|
137
162
|
|
|
138
|
-
/**
|
|
139
|
-
* Generated bundle index. Do not edit.
|
|
163
|
+
/**
|
|
164
|
+
* Generated bundle index. Do not edit.
|
|
140
165
|
*/
|
|
141
166
|
|
|
142
167
|
exports.EnumPipe = EnumPipe;
|
|
@@ -1 +1 @@
|
|
|
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';\
|
|
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';\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":["Pipe","isArray","NgModule"],"mappings":";;;;;;;QAME,0BAAoB,SAA2B;YAA3B,cAAS,GAAT,SAAS,CAAkB;SAAK;QAEpD,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;g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AAC,CAAC;gBAC9D;oBACE,OAAO,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC;aACxD;SACF;;;oEApBU,QAAQ;2DAAR,QAAQ;;6BAAR,QAAQ;sBAHpBA,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 +1,2 @@
|
|
|
1
|
-
!function(e,
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@ngx-translate/core"),require("rxjs/internal-compatibility"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define("@apipass/pipes",["exports","@angular/core","@ngx-translate/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.i1,e.rxjs["internal-compatibility"],e.ng.platformBrowser)}(this,(function(e,t,r,n,i){"use strict";var s=function(){function e(e){this.translate=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}();s.ɵfac=function(e){return new(e||s)(t.ɵɵdirectiveInject(r.TranslateService))},s.ɵpipe=t.ɵɵdefinePipe({name:"selectFilter",type:s,pure:!0});var a=function(){function e(e){this.translate=e}return e.prototype.transform=function(e,t){var r=this,n=t;return n?(n=n.toLowerCase(),e.filter((function(e){return r.translate.instant(e.value).toLowerCase().indexOf(n)>-1}))):e},e}();a.ɵfac=function(e){return new(e||a)(t.ɵɵdirectiveInject(r.TranslateService))},a.ɵpipe=t.ɵɵdefinePipe({name:"selectEnumFilter",type:a,pure:!0});var o=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&&n.isArray(t)?t.some((function(t){return e===t})):!!t&&e===t},e}();o.ɵfac=function(e){return new(e||o)},o.ɵpipe=t.ɵɵdefinePipe({name:"enum",type:o,pure:!0});var u=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}();u.ɵfac=function(e){return new(e||u)(t.ɵɵdirectiveInject(i.DomSanitizer))},u.ɵpipe=t.ɵɵdefinePipe({name:"safe",type:u,pure:!0});var p=function(){};p.ɵmod=t.ɵɵdefineNgModule({type:p}),p.ɵinj=t.ɵɵdefineInjector({factory:function(e){return new(e||p)}}),("undefined"==typeof ngJitMode||ngJitMode)&&t.ɵɵsetNgModuleScope(p,{declarations:[s,a,o,u],exports:[s,a,o,u]}),e.EnumPipe=o,e.PipeModule=p,e.SafePipe=u,e.SelectEnumFilterPipe=a,e.SelectFilterPipe=s,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
2
2
|
//# sourceMappingURL=apipass-pipes.umd.min.js.map
|
|
@@ -1 +1 @@
|
|
|
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","translate","this","prototype","transform","items","arg1","arg2","searchText","termName","toLowerCase","filter","item","indexOf","
|
|
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","translate","this","prototype","transform","items","arg1","arg2","searchText","termName","toLowerCase","filter","item","indexOf","i0","ɵɵdirectiveInject","i1","TranslateService","pure","SelectEnumFilterPipe","_this","instant","value","EnumPipe","exception","keys","add","enumMember","hasOwnProperty","isException","push","key","enumValue","isArray","some","exceptionValue","SafePipe","sanitizer","type","bypassSecurityTrustHtml","bypassSecurityTrustStyle","bypassSecurityTrustScript","bypassSecurityTrustUrl","bypassSecurityTrustResourceUrl","i1$1","DomSanitizer","PipeModule","declarations","exports"],"mappings":"kmBAME,SAAAA,EAAoBC,GAAAC,KAAAD,UAAAA,SAEpBD,EAAAG,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,yCATAL,GAAgBc,EAAAC,kBAAAC,EAAAC,qEAAhBjB,EAAgBkB,MAAA,qBCE3B,SAAAC,EAAoBlB,GAAAC,KAAAD,UAAAA,SAGpBkB,EAAAhB,UAAAC,UAAA,SAAUC,EAAcC,GAAxB,IAAAc,EAAAlB,KACMM,EAAaF,EACjB,OAAKE,GAGLA,EAAaA,EAA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ourcesContent":["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"]}
|
package/esm2015/apipass-pipes.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './public-api';
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './public-api';
|
|
5
5
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBpcGFzcy1waXBlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL3BpcGVzL3NyYy9hcGlwYXNzLXBpcGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vcHVibGljLWFwaSc7XG4iXX0=
|
package/esm2015/lib/keys.pipe.js
CHANGED
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
import { Pipe } from '@angular/core';
|
|
2
|
-
import { isArray } from 'rxjs/internal-compatibility';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import { Pipe } from '@angular/core';
|
|
2
|
+
import { isArray } from 'rxjs/internal-compatibility';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export class EnumPipe {
|
|
5
|
+
transform(value, exception) {
|
|
6
|
+
const keys = [];
|
|
7
|
+
let add = true;
|
|
8
|
+
for (const enumMember in value) {
|
|
9
|
+
if (!value.hasOwnProperty(enumMember)) {
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
if (add && !this.isException(value[enumMember], exception)) {
|
|
13
|
+
keys.push({ key: enumMember, value: value[enumMember] });
|
|
14
|
+
}
|
|
15
|
+
add = !add;
|
|
16
|
+
}
|
|
17
|
+
return keys;
|
|
18
|
+
}
|
|
19
|
+
isException(enumValue, exception) {
|
|
20
|
+
if (exception && isArray(exception)) {
|
|
21
|
+
return exception.some((exceptionValue) => enumValue === exceptionValue);
|
|
22
|
+
}
|
|
23
|
+
return exception ? enumValue === exception : false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
EnumPipe.ɵfac = function EnumPipe_Factory(t) { return new (t || EnumPipe)(); };
|
|
27
|
+
EnumPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "enum", type: EnumPipe, pure: true });
|
|
28
|
+
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(EnumPipe, [{
|
|
29
|
+
type: Pipe,
|
|
30
|
+
args: [{ name: 'enum' }]
|
|
31
|
+
}], null, null); })();
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia2V5cy5waXBlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvcGlwZXMvc3JjL2xpYi9rZXlzLnBpcGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLElBQUksRUFBZ0IsTUFBTSxlQUFlLENBQUM7QUFDbEQsT0FBTyxFQUFDLE9BQU8sRUFBQyxNQUFNLDZCQUE2QixDQUFDOztBQUdwRCxNQUFNLE9BQU8sUUFBUTtJQUVuQixTQUFTLENBQUMsS0FBVSxFQUFFLFNBQWU7UUFDbkMsTUFBTSxJQUFJLEdBQUcsRUFBRSxDQUFDO1FBQ2hCLElBQUksR0FBRyxHQUFHLElBQUksQ0FBQztRQUVmLEtBQUssTUFBTSxVQUFVLElBQUksS0FBSyxFQUFFO1lBQzlCLElBQUksQ0FBQyxLQUFLLENBQUMsY0FBYyxDQUFDLFVBQVUsQ0FBQyxFQUFFO2dCQUNyQyxTQUFTO2FBQ1Y7WUFDRCxJQUFJLEdBQUcsSUFBSSxDQUFDLElBQUksQ0FBQyxXQUFXLENBQUMsS0FBSyxDQUFDLFVBQVUsQ0FBQyxFQUFFLFNBQVMsQ0FBQyxFQUFFO2dCQUMxRCxJQUFJLENBQUMsSUFBSSxDQUFDLEVBQUMsR0FBRyxFQUFFLFVBQVUsRUFBRSxLQUFLLEVBQUUsS0FBSyxDQUFDLFVBQVUsQ0FBQyxFQUFDLENBQUMsQ0FBQzthQUN4RDtZQUNELEdBQUcsR0FBRyxDQUF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