@ng-atomic/common 4.0.3 → 4.1.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/esm2020/pipes/pagination/index.mjs +3 -0
- package/esm2020/pipes/pagination/ng-atomic-common-pipes-pagination.mjs +5 -0
- package/esm2020/pipes/pagination/pagination.module.mjs +25 -0
- package/esm2020/pipes/pagination/pagination.pipe.mjs +30 -0
- package/fesm2015/ng-atomic-common-pipes-pagination.mjs +65 -0
- package/fesm2015/ng-atomic-common-pipes-pagination.mjs.map +1 -0
- package/fesm2020/ng-atomic-common-pipes-pagination.mjs +58 -0
- package/fesm2020/ng-atomic-common-pipes-pagination.mjs.map +1 -0
- package/package.json +10 -10
- package/pipes/pagination/index.d.ts +3 -0
- package/pipes/pagination/index.d.ts.map +1 -0
- package/pipes/pagination/ng-atomic-common-pipes-pagination.d.ts.map +1 -0
- package/pipes/pagination/pagination.module.d.ts +9 -0
- package/pipes/pagination/pagination.module.d.ts.map +1 -0
- package/pipes/pagination/pagination.pipe.d.ts +17 -0
- package/pipes/pagination/pagination.pipe.d.ts.map +1 -0
- package/esm2020/pipes/smart-clamp/index.mjs +0 -3
- package/esm2020/pipes/smart-clamp/ng-atomic-common-pipes-smart-clamp.mjs +0 -5
- package/esm2020/pipes/smart-clamp/smart-clamp.module.mjs +0 -25
- package/esm2020/pipes/smart-clamp/smart-clamp.pipe.mjs +0 -44
- package/fesm2015/ng-atomic-common-pipes-smart-clamp.mjs +0 -79
- package/fesm2015/ng-atomic-common-pipes-smart-clamp.mjs.map +0 -1
- package/fesm2020/ng-atomic-common-pipes-smart-clamp.mjs +0 -72
- package/fesm2020/ng-atomic-common-pipes-smart-clamp.mjs.map +0 -1
- package/pipes/smart-clamp/index.d.ts +0 -3
- package/pipes/smart-clamp/index.d.ts.map +0 -1
- package/pipes/smart-clamp/ng-atomic-common-pipes-smart-clamp.d.ts.map +0 -1
- package/pipes/smart-clamp/smart-clamp.module.d.ts +0 -9
- package/pipes/smart-clamp/smart-clamp.module.d.ts.map +0 -1
- package/pipes/smart-clamp/smart-clamp.pipe.d.ts +0 -15
- package/pipes/smart-clamp/smart-clamp.pipe.d.ts.map +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export * from './pagination.module';
|
|
2
|
+
export * from './pagination.pipe';
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbW1vbi9zcmMvcGlwZXMvcGFnaW5hdGlvbi9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLHFCQUFxQixDQUFDO0FBQ3BDLGNBQWMsbUJBQW1CLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL3BhZ2luYXRpb24ubW9kdWxlJztcbmV4cG9ydCAqIGZyb20gJy4vcGFnaW5hdGlvbi5waXBlJztcbiJdfQ==
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './index';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmctYXRvbWljLWNvbW1vbi1waXBlcy1wYWdpbmF0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21tb24vc3JjL3BpcGVzL3BhZ2luYXRpb24vbmctYXRvbWljLWNvbW1vbi1waXBlcy1wYWdpbmF0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { PaginationPipe } from './pagination.pipe';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export class PaginationModule {
|
|
6
|
+
}
|
|
7
|
+
PaginationModule.ɵfac = function PaginationModule_Factory(t) { return new (t || PaginationModule)(); };
|
|
8
|
+
PaginationModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: PaginationModule });
|
|
9
|
+
PaginationModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule] });
|
|
10
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PaginationModule, [{
|
|
11
|
+
type: NgModule,
|
|
12
|
+
args: [{
|
|
13
|
+
declarations: [
|
|
14
|
+
PaginationPipe
|
|
15
|
+
],
|
|
16
|
+
imports: [
|
|
17
|
+
CommonModule,
|
|
18
|
+
],
|
|
19
|
+
exports: [
|
|
20
|
+
PaginationPipe
|
|
21
|
+
]
|
|
22
|
+
}]
|
|
23
|
+
}], null, null); })();
|
|
24
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(PaginationModule, { declarations: [PaginationPipe], imports: [CommonModule], exports: [PaginationPipe] }); })();
|
|
25
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFnaW5hdGlvbi5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbW1vbi9zcmMvcGlwZXMvcGFnaW5hdGlvbi9wYWdpbmF0aW9uLm1vZHVsZS50cyJdLCJuYW1lcyI6W10s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e } from '@angular/core';
|
|
3
|
+
import { smartSortByTransformer, SMART_SORT_BY_TRANSFORMER } from '@ng-atomic/common/pipes/smart-sort-by';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export class PaginationPipe {
|
|
6
|
+
constructor(transformer) {
|
|
7
|
+
this.transformer = transformer;
|
|
8
|
+
this.slicePipe = new SlicePipe();
|
|
9
|
+
this.transformer ?? (this.transformer = smartSortByTransformer);
|
|
10
|
+
}
|
|
11
|
+
transform(items, { sortKey, sortOrder, start, end }) {
|
|
12
|
+
// transform<T>(items: T[], key: string, order: 'asc' | 'desc', start: number, end: number): T[] {
|
|
13
|
+
return this.slicePipe.transform(this.transformer(items, sortKey, sortOrder), start, end);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
PaginationPipe.ɵfac = function PaginationPipe_Factory(t) { return new (t || PaginationPipe)(i0.ɵɵdirectiveInject(SMART_SORT_BY_TRANSFORMER, 24)); };
|
|
17
|
+
PaginationPipe.ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "pagination", type: PaginationPipe, pure: true });
|
|
18
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PaginationPipe, [{
|
|
19
|
+
type: Pipe,
|
|
20
|
+
args: [{
|
|
21
|
+
name: 'pagination',
|
|
22
|
+
pure: true,
|
|
23
|
+
}]
|
|
24
|
+
}], function () { return [{ type: undefined, decorators: [{
|
|
25
|
+
type: Optional
|
|
26
|
+
}, {
|
|
27
|
+
type: Inject,
|
|
28
|
+
args: [SMART_SORT_BY_TRANSFORMER]
|
|
29
|
+
}] }]; }, null); })();
|
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFnaW5hdGlvbi5waXBlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21tb24vc3JjL3BpcGVzL3BhZ2luYX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lbmQ6IG51bWJlcik6IFRbXSB7ICAgIFxuICAgIHJldHVybiB0aGlzLnNsaWNlUGlwZS50cmFuc2Zvcm0odGhpcy50cmFuc2Zvcm1lcihpdGVtcywgc29ydEtleSwgc29ydE9yZGVyKSwgc3RhcnQsIGVuZCk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Pipe, Optional, Inject, NgModule } from '@angular/core';
|
|
3
|
+
import { SlicePipe, CommonModule } from '@angular/common';
|
|
4
|
+
import { smartSortByTransformer, SMART_SORT_BY_TRANSFORMER } from '@ng-atomic/common/pipes/smart-sort-by';
|
|
5
|
+
|
|
6
|
+
class PaginationPipe {
|
|
7
|
+
constructor(transformer) {
|
|
8
|
+
var _a;
|
|
9
|
+
this.transformer = transformer;
|
|
10
|
+
this.slicePipe = new SlicePipe();
|
|
11
|
+
(_a = this.transformer) !== null && _a !== void 0 ? _a : (this.transformer = smartSortByTransformer);
|
|
12
|
+
}
|
|
13
|
+
transform(items, { sortKey, sortOrder, start, end }) {
|
|
14
|
+
// transform<T>(items: T[], key: string, order: 'asc' | 'desc', start: number, end: number): T[] {
|
|
15
|
+
return this.slicePipe.transform(this.transformer(items, sortKey, sortOrder), start, end);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
PaginationPipe.ɵfac = function PaginationPipe_Factory(t) { return new (t || PaginationPipe)(i0.ɵɵdirectiveInject(SMART_SORT_BY_TRANSFORMER, 24)); };
|
|
19
|
+
PaginationPipe.ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "pagination", type: PaginationPipe, pure: true });
|
|
20
|
+
(function () {
|
|
21
|
+
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PaginationPipe, [{
|
|
22
|
+
type: Pipe,
|
|
23
|
+
args: [{
|
|
24
|
+
name: 'pagination',
|
|
25
|
+
pure: true,
|
|
26
|
+
}]
|
|
27
|
+
}], function () {
|
|
28
|
+
return [{ type: undefined, decorators: [{
|
|
29
|
+
type: Optional
|
|
30
|
+
}, {
|
|
31
|
+
type: Inject,
|
|
32
|
+
args: [SMART_SORT_BY_TRANSFORMER]
|
|
33
|
+
}] }];
|
|
34
|
+
}, null);
|
|
35
|
+
})();
|
|
36
|
+
|
|
37
|
+
class PaginationModule {
|
|
38
|
+
}
|
|
39
|
+
PaginationModule.ɵfac = function PaginationModule_Factory(t) { return new (t || PaginationModule)(); };
|
|
40
|
+
PaginationModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: PaginationModule });
|
|
41
|
+
PaginationModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule] });
|
|
42
|
+
(function () {
|
|
43
|
+
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PaginationModule, [{
|
|
44
|
+
type: NgModule,
|
|
45
|
+
args: [{
|
|
46
|
+
declarations: [
|
|
47
|
+
PaginationPipe
|
|
48
|
+
],
|
|
49
|
+
imports: [
|
|
50
|
+
CommonModule,
|
|
51
|
+
],
|
|
52
|
+
exports: [
|
|
53
|
+
PaginationPipe
|
|
54
|
+
]
|
|
55
|
+
}]
|
|
56
|
+
}], null, null);
|
|
57
|
+
})();
|
|
58
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(PaginationModule, { declarations: [PaginationPipe], imports: [CommonModule], exports: [PaginationPipe] }); })();
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Generated bundle index. Do not edit.
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
export { PaginationModule, PaginationPipe };
|
|
65
|
+
//# sourceMappingURL=ng-atomic-common-pipes-pagination.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-atomic-common-pipes-pagination.mjs","sources":["../../../../libs/common/src/pipes/pagination/pagination.pipe.ts","../../../../libs/common/src/pipes/pagination/pagination.module.ts","../../../../libs/common/src/pipes/pagination/ng-atomic-common-pipes-pagination.ts"],"sourcesContent":["import { SlicePipe } from '@angular/common';\nimport { Inject, Optional, Pipe, PipeTransform } from '@angular/core';\nimport { smartSortByTransformer, SmartSortByTransformer, SMART_SORT_BY_TRANSFORMER } from '@ng-atomic/common/pipes/smart-sort-by';\n\n@Pipe({\n name: 'pagination',\n pure: true,\n})\nexport class PaginationPipe implements PipeTransform {\n private slicePipe = new SlicePipe();\n\n constructor(\n @Optional()\n @Inject(SMART_SORT_BY_TRANSFORMER)\n private transformer: SmartSortByTransformer,\n ) {\n this.transformer ??= smartSortByTransformer;\n }\n\n transform<T>(items: T[], {sortKey, sortOrder, start, end}: {sortKey: string, sortOrder: 'asc' | 'desc', start: number, end: number}) {\n // transform<T>(items: T[], key: string, order: 'asc' | 'desc', start: number, end: number): T[] { \n return this.slicePipe.transform(this.transformer(items, sortKey, sortOrder), start, end);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { PaginationPipe } from './pagination.pipe';\n\n\n\n@NgModule({\n declarations: [\n PaginationPipe\n ],\n imports: [\n CommonModule,\n ],\n exports: [\n PaginationPipe\n ]\n})\nexport class PaginationModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAQa,cAAc,CAAA;AAGzB,IAAA,WAAA,CAGU,WAAmC,EAAA;;AAAnC,QAAA,IAAW,CAAA,WAAA,GAAX,WAAW,CAAwB;AALrC,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;QAOlC,CAAA,EAAA,GAAA,IAAI,CAAC,WAAW,MAAhB,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,IAAA,IAAI,CAAC,WAAW,GAAK,sBAAsB,CAAC,CAAA;KAC7C;IAED,SAAS,CAAI,KAAU,EAAE,EAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,G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1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Pipe, Optional, Inject, NgModule } from '@angular/core';
|
|
3
|
+
import { SlicePipe, CommonModule } from '@angular/common';
|
|
4
|
+
import { smartSortByTransformer, SMART_SORT_BY_TRANSFORMER } from '@ng-atomic/common/pipes/smart-sort-by';
|
|
5
|
+
|
|
6
|
+
class PaginationPipe {
|
|
7
|
+
constructor(transformer) {
|
|
8
|
+
this.transformer = transformer;
|
|
9
|
+
this.slicePipe = new SlicePipe();
|
|
10
|
+
this.transformer ?? (this.transformer = smartSortByTransformer);
|
|
11
|
+
}
|
|
12
|
+
transform(items, { sortKey, sortOrder, start, end }) {
|
|
13
|
+
// transform<T>(items: T[], key: string, order: 'asc' | 'desc', start: number, end: number): T[] {
|
|
14
|
+
return this.slicePipe.transform(this.transformer(items, sortKey, sortOrder), start, end);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
PaginationPipe.ɵfac = function PaginationPipe_Factory(t) { return new (t || PaginationPipe)(i0.ɵɵdirectiveInject(SMART_SORT_BY_TRANSFORMER, 24)); };
|
|
18
|
+
PaginationPipe.ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "pagination", type: PaginationPipe, pure: true });
|
|
19
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PaginationPipe, [{
|
|
20
|
+
type: Pipe,
|
|
21
|
+
args: [{
|
|
22
|
+
name: 'pagination',
|
|
23
|
+
pure: true,
|
|
24
|
+
}]
|
|
25
|
+
}], function () { return [{ type: undefined, decorators: [{
|
|
26
|
+
type: Optional
|
|
27
|
+
}, {
|
|
28
|
+
type: Inject,
|
|
29
|
+
args: [SMART_SORT_BY_TRANSFORMER]
|
|
30
|
+
}] }]; }, null); })();
|
|
31
|
+
|
|
32
|
+
class PaginationModule {
|
|
33
|
+
}
|
|
34
|
+
PaginationModule.ɵfac = function PaginationModule_Factory(t) { return new (t || PaginationModule)(); };
|
|
35
|
+
PaginationModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: PaginationModule });
|
|
36
|
+
PaginationModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule] });
|
|
37
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PaginationModule, [{
|
|
38
|
+
type: NgModule,
|
|
39
|
+
args: [{
|
|
40
|
+
declarations: [
|
|
41
|
+
PaginationPipe
|
|
42
|
+
],
|
|
43
|
+
imports: [
|
|
44
|
+
CommonModule,
|
|
45
|
+
],
|
|
46
|
+
exports: [
|
|
47
|
+
PaginationPipe
|
|
48
|
+
]
|
|
49
|
+
}]
|
|
50
|
+
}], null, null); })();
|
|
51
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(PaginationModule, { declarations: [PaginationPipe], imports: [CommonModule], exports: [PaginationPipe] }); })();
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Generated bundle index. Do not edit.
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
export { PaginationModule, PaginationPipe };
|
|
58
|
+
//# sourceMappingURL=ng-atomic-common-pipes-pagination.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-atomic-common-pipes-pagination.mjs","sources":["../../../../libs/common/src/pipes/pagination/pagination.pipe.ts","../../../../libs/common/src/pipes/pagination/pagination.module.ts","../../../../libs/common/src/pipes/pagination/ng-atomic-common-pipes-pagination.ts"],"sourcesContent":["import { SlicePipe } from '@angular/common';\nimport { Inject, Optional, Pipe, PipeTransform } from '@angular/core';\nimport { smartSortByTransformer, SmartSortByTransformer, SMART_SORT_BY_TRANSFORMER } from '@ng-atomic/common/pipes/smart-sort-by';\n\n@Pipe({\n name: 'pagination',\n pure: true,\n})\nexport class PaginationPipe implements PipeTransform {\n private slicePipe = new SlicePipe();\n\n constructor(\n @Optional()\n @Inject(SMART_SORT_BY_TRANSFORMER)\n private transformer: SmartSortByTransformer,\n ) {\n this.transformer ??= smartSortByTransformer;\n }\n\n transform<T>(items: T[], {sortKey, sortOrder, start, end}: {sortKey: string, sortOrder: 'asc' | 'desc', start: number, end: number}) {\n // transform<T>(items: T[], key: string, order: 'asc' | 'desc', start: number, end: number): T[] { \n return this.slicePipe.transform(this.transformer(items, sortKey, sortOrder), start, end);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { PaginationPipe } from './pagination.pipe';\n\n\n\n@NgModule({\n declarations: [\n PaginationPipe\n ],\n imports: [\n CommonModule,\n ],\n exports: [\n PaginationPipe\n ]\n})\nexport class PaginationModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAQa,cAAc,CAAA;AAGzB,IAAA,WAAA,CAGU,WAAmC,EAAA;QAAnC,IAAW,CAAA,WAAA,GAAX,WAAW,CAAwB;AALrC,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;QAOlC,IAAI,CAAC,WAAW,KAAhB,IAAI,CAAC,WAAW,GAAK,sBAAsB,CAAC,CAAA;KAC7C;IAED,SAAS,CAAI,KAAU,EAAE,EAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAA2E,EAAA;;QAEjI,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;KAC1F;;AAdU,cAAA,CAAA,IAAA,GAAA,SAAA,sBAAA,CAAA,CAAA,EAAA,EAAA,OAAA,KAAA,CAAA,IAAA,cAAc,uBAKf,yBAAyB,EAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA;iFALxB,cAAc,EAAA,IAAA,EAAA,IAAA,EAAA,CAAA,CAAA;uFAAd,cAAc,EAAA,CAAA;cAJ1B,IAAI;AAAC,QAAA,IAAA,EAAA,CAAA;AACJ,gBAAA,IAAI,EAAE,YAAY;AAClB,gBAAA,IAAI,EAAE,IAAI;AACX,aAAA,CAAA;;sBAKI,QAAQ;;sBACR,MAAM;uBAAC,yBAAyB,CAAA;;;MCIxB,gBAAgB,CAAA;;gFAAhB,gBAAgB,GAAA,CAAA,EAAA,CAAA;kEAAhB,gBAAgB,EAAA,CAAA,CAAA;sEANzB,YAAY,CAAA,EAAA,CAAA,CAAA;uFAMH,gBAAgB,EAAA,CAAA;cAX5B,QAAQ;AAAC,QAAA,IAAA,EAAA,CAAA;AACR,gBAAA,YAAY,EAAE;oBACZ,cAAc;AACf,iBAAA;AACD,gBAAA,OAAO,EAAE;oBACP,YAAY;AACb,iBAAA;AACD,gBAAA,OAAO,EAAE;oBACP,cAAc;AACf,iBAAA;AACF,aAAA,CAAA;;AACY,CAAA,YAAA,EAAA,CAAA,OAAA,SAAA,KAAA,WAAA,IAAA,SAAA,KAAA,EAAA,CAAA,kBAAA,CAAA,gBAAgB,EATzB,EAAA,YAAA,EAAA,CAAA,cAAc,CAGd,EAAA,OAAA,EAAA,CAAA,YAAY,aAGZ,cAAc,CAAA,EAAA,CAAA,CAAA,EAAA,GAAA;;ACdlB;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-atomic/common",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"module": "fesm2015/ng-atomic-common.mjs",
|
|
6
6
|
"es2020": "fesm2020/ng-atomic-common.mjs",
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"node": "./fesm2015/ng-atomic-common-pipes-domain.mjs",
|
|
45
45
|
"default": "./fesm2020/ng-atomic-common-pipes-domain.mjs"
|
|
46
46
|
},
|
|
47
|
-
"./pipes/
|
|
48
|
-
"types": "./pipes/
|
|
49
|
-
"esm2020": "./esm2020/pipes/
|
|
50
|
-
"es2020": "./fesm2020/ng-atomic-common-pipes-
|
|
51
|
-
"es2015": "./fesm2015/ng-atomic-common-pipes-
|
|
52
|
-
"node": "./fesm2015/ng-atomic-common-pipes-
|
|
53
|
-
"default": "./fesm2020/ng-atomic-common-pipes-
|
|
47
|
+
"./pipes/pagination": {
|
|
48
|
+
"types": "./pipes/pagination/index.d.ts",
|
|
49
|
+
"esm2020": "./esm2020/pipes/pagination/ng-atomic-common-pipes-pagination.mjs",
|
|
50
|
+
"es2020": "./fesm2020/ng-atomic-common-pipes-pagination.mjs",
|
|
51
|
+
"es2015": "./fesm2015/ng-atomic-common-pipes-pagination.mjs",
|
|
52
|
+
"node": "./fesm2015/ng-atomic-common-pipes-pagination.mjs",
|
|
53
|
+
"default": "./fesm2020/ng-atomic-common-pipes-pagination.mjs"
|
|
54
54
|
},
|
|
55
55
|
"./pipes/smart-exp": {
|
|
56
56
|
"types": "./pipes/smart-exp/index.d.ts",
|
|
@@ -157,8 +157,8 @@
|
|
|
157
157
|
"prepublishOnly": "node --eval \"console.error('ERROR: Trying to publish a package that has been compiled by Ivy in full compilation mode. This is not allowed.\\nPlease delete and rebuild the package with Ivy partial compilation mode, before attempting to publish.\\n')\" && exit 1"
|
|
158
158
|
},
|
|
159
159
|
"peerDependencies": {
|
|
160
|
-
"@angular/core": "14.
|
|
161
|
-
"@angular/common": "14.
|
|
160
|
+
"@angular/core": "^14.0.0",
|
|
161
|
+
"@angular/common": "^14.0.0",
|
|
162
162
|
"flat": "^5.0.2",
|
|
163
163
|
"rxjs": "7.5.0",
|
|
164
164
|
"@ngrx/component-store": "14.0.2"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../libs/common/src/pipes/pagination/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-atomic-common-pipes-pagination.d.ts","sourceRoot":"","sources":["../../../../../libs/common/src/pipes/pagination/ng-atomic-common-pipes-pagination.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./pagination.pipe";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
export declare class PaginationModule {
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PaginationModule, never>;
|
|
6
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<PaginationModule, [typeof i1.PaginationPipe], [typeof i2.CommonModule], [typeof i1.PaginationPipe]>;
|
|
7
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<PaginationModule>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=pagination.module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.module.d.ts","sourceRoot":"","sources":["../../../../../libs/common/src/pipes/pagination/pagination.module.ts"],"names":[],"mappings":";;;AAMA,qBAWa,gBAAgB;yCAAhB,gBAAgB;0CAAhB,gBAAgB;0CAAhB,gBAAgB;CAAI"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import { SmartSortByTransformer } from '@ng-atomic/common/pipes/smart-sort-by';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class PaginationPipe implements PipeTransform {
|
|
5
|
+
private transformer;
|
|
6
|
+
private slicePipe;
|
|
7
|
+
constructor(transformer: SmartSortByTransformer);
|
|
8
|
+
transform<T>(items: T[], { sortKey, sortOrder, start, end }: {
|
|
9
|
+
sortKey: string;
|
|
10
|
+
sortOrder: 'asc' | 'desc';
|
|
11
|
+
start: number;
|
|
12
|
+
end: number;
|
|
13
|
+
}): T[];
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PaginationPipe, [{ optional: true; }]>;
|
|
15
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<PaginationPipe, "pagination", false>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=pagination.pipe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.pipe.d.ts","sourceRoot":"","sources":["../../../../../libs/common/src/pipes/pagination/pagination.pipe.ts"],"names":[],"mappings":"AACA,OAAO,EAA0B,aAAa,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAA0B,sBAAsB,EAA6B,MAAM,uCAAuC,CAAC;;AAElI,qBAIa,cAAe,YAAW,aAAa;IAMhD,OAAO,CAAC,WAAW;IALrB,OAAO,CAAC,SAAS,CAAmB;gBAK1B,WAAW,EAAE,sBAAsB;IAK7C,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAC,EAAE;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,KAAK,GAAG,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAC;yCAXxH,cAAc;uCAAd,cAAc;CAe1B"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export * from './smart-clamp.module';
|
|
2
|
-
export * from './smart-clamp.pipe';
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbW1vbi9zcmMvcGlwZXMvc21hcnQtY2xhbXAvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxzQkFBc0IsQ0FBQztBQUNyQyxjQUFjLG9CQUFvQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9zbWFydC1jbGFtcC5tb2R1bGUnO1xuZXhwb3J0ICogZnJvbSAnLi9zbWFydC1jbGFtcC5waXBlJztcbiJdfQ==
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './index';
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmctYXRvbWljLWNvbW1vbi1waXBlcy1zbWFydC1jbGFtcC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29tbW9uL3NyYy9waXBlcy9zbWFydC1jbGFtcC9uZy1hdG9taWMtY29tbW9uLXBpcGVzLXNtYXJ0LWNsYW1wLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { SmartClampPipe } from './smart-clamp.pipe';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export class SmartClampModule {
|
|
6
|
-
}
|
|
7
|
-
SmartClampModule.ɵfac = function SmartClampModule_Factory(t) { return new (t || SmartClampModule)(); };
|
|
8
|
-
SmartClampModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: SmartClampModule });
|
|
9
|
-
SmartClampModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule] });
|
|
10
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SmartClampModule, [{
|
|
11
|
-
type: NgModule,
|
|
12
|
-
args: [{
|
|
13
|
-
declarations: [
|
|
14
|
-
SmartClampPipe
|
|
15
|
-
],
|
|
16
|
-
imports: [
|
|
17
|
-
CommonModule,
|
|
18
|
-
],
|
|
19
|
-
exports: [
|
|
20
|
-
SmartClampPipe
|
|
21
|
-
]
|
|
22
|
-
}]
|
|
23
|
-
}], null, null); })();
|
|
24
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(SmartClampModule, { declarations: [SmartClampPipe], imports: [CommonModule], exports: [SmartClampPipe] }); })();
|
|
25
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnQtY2xhbXAubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21tb24vc3JjL3BpcGVzL3NtYXJ0LWNsYW1wL3NtYXJ0LWNsYW1wLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3pDLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUMvQyxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7O0FBZXBELE1BQU0sT0FBTyxnQkFBZ0I7O2dGQUFoQixnQkFBZ0I7a0VBQWhCLGdCQUFnQjtzRUFOekIsWUFBWTt1RkFNSCxnQkFBZ0I7Y0FYNUIsUUFBUTtlQUFDO2dCQUNSLFlBQVksRUFBRTtvQkFDWixjQUFjO2lCQUNmO2dCQUNELE9BQU8sRUFBRTtvQkFDUCxZQUFZO2lCQUNiO2dCQUNELE9BQU8sRUFBRTtvQkFDUCxjQUFjO2lCQUNmO2FBQ0Y7O3dGQUNZLGdCQUFnQixtQkFUekIsY0FBYyxhQUdkLFlBQVksYUFHWixjQUFjIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTmdNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IENvbW1vbk1vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvbW1vbic7XG5pbXBvcnQgeyBTbWFydENsYW1wUGlwZSB9IGZyb20gJy4vc21hcnQtY2xhbXAucGlwZSc7XG5cblxuXG5ATmdNb2R1bGUoe1xuICBkZWNsYXJhdGlvbnM6IFtcbiAgICBTbWFydENsYW1wUGlwZVxuICBdLFxuICBpbXBvcnRzOiBbXG4gICAgQ29tbW9uTW9kdWxlLFxuICBdLFxuICBleHBvcnRzOiBbXG4gICAgU21hcnRDbGFtcFBpcGVcbiAgXVxufSlcbmV4cG9ydCBjbGFzcyBTbWFydENsYW1wTW9kdWxlIHsgfVxuIl19
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { SlicePipe } from '@angular/common';
|
|
2
|
-
import { Inject, Optional, Pipe } from '@angular/core';
|
|
3
|
-
import { smartSortByTransformer, SMART_SORT_BY_TRANSFORMER } from '@ng-atomic/common/pipes/smart-sort-by';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export class SmartClampPipe {
|
|
6
|
-
constructor(transformer) {
|
|
7
|
-
this.transformer = transformer;
|
|
8
|
-
this.slicePipe = new SlicePipe();
|
|
9
|
-
this._input = null;
|
|
10
|
-
this._output = [];
|
|
11
|
-
this.transformer ?? (this.transformer = smartSortByTransformer);
|
|
12
|
-
}
|
|
13
|
-
transform(items, store) {
|
|
14
|
-
const input = {
|
|
15
|
-
items,
|
|
16
|
-
sortKey: store.sortKey,
|
|
17
|
-
sortOrder: store.sortOrder,
|
|
18
|
-
start: store.page.start,
|
|
19
|
-
end: store.page.end,
|
|
20
|
-
};
|
|
21
|
-
if (JSON.stringify(input) === JSON.stringify(this._input)) {
|
|
22
|
-
return this._output;
|
|
23
|
-
}
|
|
24
|
-
this._input = input;
|
|
25
|
-
items = this.transformer(items, store?.sortKey, store?.sortOrder);
|
|
26
|
-
items = this.slicePipe.transform(items, store.page.start, store.page.end);
|
|
27
|
-
return this._output = items;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
SmartClampPipe.ɵfac = function SmartClampPipe_Factory(t) { return new (t || SmartClampPipe)(i0.ɵɵdirectiveInject(SMART_SORT_BY_TRANSFORMER, 24)); };
|
|
31
|
-
SmartClampPipe.ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "smartClamp", type: SmartClampPipe, pure: false });
|
|
32
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SmartClampPipe, [{
|
|
33
|
-
type: Pipe,
|
|
34
|
-
args: [{
|
|
35
|
-
name: 'smartClamp',
|
|
36
|
-
pure: false,
|
|
37
|
-
}]
|
|
38
|
-
}], function () { return [{ type: undefined, decorators: [{
|
|
39
|
-
type: Optional
|
|
40
|
-
}, {
|
|
41
|
-
type: Inject,
|
|
42
|
-
args: [SMART_SORT_BY_TRANSFORMER]
|
|
43
|
-
}] }]; }, null); })();
|
|
44
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnQtY2xhbXAucGlwZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29tbW9uL3NyYy9waXBlcy9zbWFydC1jbGFtcC9zbWFydC1jbGFtcC5waXBlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUM1QyxPQUFPLEVBQUUsTUFBTSxFQUFFLFFBQVEsRUFBRSxJQUFJLEVBQWlCLE1BQU0sZUFBZSxDQUFDO0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cy5fb3V0cHV0ID0gaXRlbXM7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Pipe, Optional, Inject, NgModule } from '@angular/core';
|
|
3
|
-
import { SlicePipe, CommonModule } from '@angular/common';
|
|
4
|
-
import { smartSortByTransformer, SMART_SORT_BY_TRANSFORMER } from '@ng-atomic/common/pipes/smart-sort-by';
|
|
5
|
-
|
|
6
|
-
class SmartClampPipe {
|
|
7
|
-
constructor(transformer) {
|
|
8
|
-
var _a;
|
|
9
|
-
this.transformer = transformer;
|
|
10
|
-
this.slicePipe = new SlicePipe();
|
|
11
|
-
this._input = null;
|
|
12
|
-
this._output = [];
|
|
13
|
-
(_a = this.transformer) !== null && _a !== void 0 ? _a : (this.transformer = smartSortByTransformer);
|
|
14
|
-
}
|
|
15
|
-
transform(items, store) {
|
|
16
|
-
const input = {
|
|
17
|
-
items,
|
|
18
|
-
sortKey: store.sortKey,
|
|
19
|
-
sortOrder: store.sortOrder,
|
|
20
|
-
start: store.page.start,
|
|
21
|
-
end: store.page.end,
|
|
22
|
-
};
|
|
23
|
-
if (JSON.stringify(input) === JSON.stringify(this._input)) {
|
|
24
|
-
return this._output;
|
|
25
|
-
}
|
|
26
|
-
this._input = input;
|
|
27
|
-
items = this.transformer(items, store === null || store === void 0 ? void 0 : store.sortKey, store === null || store === void 0 ? void 0 : store.sortOrder);
|
|
28
|
-
items = this.slicePipe.transform(items, store.page.start, store.page.end);
|
|
29
|
-
return this._output = items;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
SmartClampPipe.ɵfac = function SmartClampPipe_Factory(t) { return new (t || SmartClampPipe)(i0.ɵɵdirectiveInject(SMART_SORT_BY_TRANSFORMER, 24)); };
|
|
33
|
-
SmartClampPipe.ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "smartClamp", type: SmartClampPipe, pure: false });
|
|
34
|
-
(function () {
|
|
35
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SmartClampPipe, [{
|
|
36
|
-
type: Pipe,
|
|
37
|
-
args: [{
|
|
38
|
-
name: 'smartClamp',
|
|
39
|
-
pure: false,
|
|
40
|
-
}]
|
|
41
|
-
}], function () {
|
|
42
|
-
return [{ type: undefined, decorators: [{
|
|
43
|
-
type: Optional
|
|
44
|
-
}, {
|
|
45
|
-
type: Inject,
|
|
46
|
-
args: [SMART_SORT_BY_TRANSFORMER]
|
|
47
|
-
}] }];
|
|
48
|
-
}, null);
|
|
49
|
-
})();
|
|
50
|
-
|
|
51
|
-
class SmartClampModule {
|
|
52
|
-
}
|
|
53
|
-
SmartClampModule.ɵfac = function SmartClampModule_Factory(t) { return new (t || SmartClampModule)(); };
|
|
54
|
-
SmartClampModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: SmartClampModule });
|
|
55
|
-
SmartClampModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule] });
|
|
56
|
-
(function () {
|
|
57
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SmartClampModule, [{
|
|
58
|
-
type: NgModule,
|
|
59
|
-
args: [{
|
|
60
|
-
declarations: [
|
|
61
|
-
SmartClampPipe
|
|
62
|
-
],
|
|
63
|
-
imports: [
|
|
64
|
-
CommonModule,
|
|
65
|
-
],
|
|
66
|
-
exports: [
|
|
67
|
-
SmartClampPipe
|
|
68
|
-
]
|
|
69
|
-
}]
|
|
70
|
-
}], null, null);
|
|
71
|
-
})();
|
|
72
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(SmartClampModule, { declarations: [SmartClampPipe], imports: [CommonModule], exports: [SmartClampPipe] }); })();
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Generated bundle index. Do not edit.
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
export { SmartClampModule, SmartClampPipe };
|
|
79
|
-
//# sourceMappingURL=ng-atomic-common-pipes-smart-clamp.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ng-atomic-common-pipes-smart-clamp.mjs","sources":["../../../../libs/common/src/pipes/smart-clamp/smart-clamp.pipe.ts","../../../../libs/common/src/pipes/smart-clamp/smart-clamp.module.ts","../../../../libs/common/src/pipes/smart-clamp/ng-atomic-common-pipes-smart-clamp.ts"],"sourcesContent":["import { SlicePipe } from '@angular/common';\nimport { Inject, Optional, Pipe, PipeTransform } from '@angular/core';\nimport { smartSortByTransformer, SmartSortByTransformer, SMART_SORT_BY_TRANSFORMER } from '@ng-atomic/common/pipes/smart-sort-by';\nimport { EntitiesStore } from '@ng-atomic/common/stores/entities';\n\n@Pipe({\n name: 'smartClamp',\n pure: false,\n})\nexport class SmartClampPipe implements PipeTransform {\n private slicePipe = new SlicePipe();\n private _input: any = null;\n private _output: any = [];\n\n constructor(\n @Optional()\n @Inject(SMART_SORT_BY_TRANSFORMER)\n private transformer: SmartSortByTransformer,\n ) {\n this.transformer ??= smartSortByTransformer;\n }\n\n transform<T>(items: T[], store: EntitiesStore<any, any>): T[] {\n const input = {\n items, \n sortKey: store.sortKey, \n sortOrder: store.sortOrder, \n start: store.page.start,\n end: store.page.end,\n };\n \n if (JSON.stringify(input) === JSON.stringify(this._input)) {\n return this._output;\n }\n\n this._input = input;\n items = this.transformer(items, store?.sortKey, store?.sortOrder as 'asc' | 'desc');\n items = this.slicePipe.transform(items, store.page.start, store.page.end);\n return this._output = items;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SmartClampPipe } from './smart-clamp.pipe';\n\n\n\n@NgModule({\n declarations: [\n SmartClampPipe\n ],\n imports: [\n CommonModule,\n ],\n exports: [\n SmartClampPipe\n ]\n})\nexport class SmartClampModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MASa,cAA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|
|
3
|
-
import { SlicePipe, CommonModule } from '@angular/common';
|
|
4
|
-
import { smartSortByTransformer, SMART_SORT_BY_TRANSFORMER } from '@ng-atomic/common/pipes/smart-sort-by';
|
|
5
|
-
|
|
6
|
-
class SmartClampPipe {
|
|
7
|
-
constructor(transformer) {
|
|
8
|
-
this.transformer = transformer;
|
|
9
|
-
this.slicePipe = new SlicePipe();
|
|
10
|
-
this._input = null;
|
|
11
|
-
this._output = [];
|
|
12
|
-
this.transformer ?? (this.transformer = smartSortByTransformer);
|
|
13
|
-
}
|
|
14
|
-
transform(items, store) {
|
|
15
|
-
const input = {
|
|
16
|
-
items,
|
|
17
|
-
sortKey: store.sortKey,
|
|
18
|
-
sortOrder: store.sortOrder,
|
|
19
|
-
start: store.page.start,
|
|
20
|
-
end: store.page.end,
|
|
21
|
-
};
|
|
22
|
-
if (JSON.stringify(input) === JSON.stringify(this._input)) {
|
|
23
|
-
return this._output;
|
|
24
|
-
}
|
|
25
|
-
this._input = input;
|
|
26
|
-
items = this.transformer(items, store?.sortKey, store?.sortOrder);
|
|
27
|
-
items = this.slicePipe.transform(items, store.page.start, store.page.end);
|
|
28
|
-
return this._output = items;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
SmartClampPipe.ɵfac = function SmartClampPipe_Factory(t) { return new (t || SmartClampPipe)(i0.ɵɵdirectiveInject(SMART_SORT_BY_TRANSFORMER, 24)); };
|
|
32
|
-
SmartClampPipe.ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "smartClamp", type: SmartClampPipe, pure: false });
|
|
33
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SmartClampPipe, [{
|
|
34
|
-
type: Pipe,
|
|
35
|
-
args: [{
|
|
36
|
-
name: 'smartClamp',
|
|
37
|
-
pure: false,
|
|
38
|
-
}]
|
|
39
|
-
}], function () { return [{ type: undefined, decorators: [{
|
|
40
|
-
type: Optional
|
|
41
|
-
}, {
|
|
42
|
-
type: Inject,
|
|
43
|
-
args: [SMART_SORT_BY_TRANSFORMER]
|
|
44
|
-
}] }]; }, null); })();
|
|
45
|
-
|
|
46
|
-
class SmartClampModule {
|
|
47
|
-
}
|
|
48
|
-
SmartClampModule.ɵfac = function SmartClampModule_Factory(t) { return new (t || SmartClampModule)(); };
|
|
49
|
-
SmartClampModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: SmartClampModule });
|
|
50
|
-
SmartClampModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule] });
|
|
51
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SmartClampModule, [{
|
|
52
|
-
type: NgModule,
|
|
53
|
-
args: [{
|
|
54
|
-
declarations: [
|
|
55
|
-
SmartClampPipe
|
|
56
|
-
],
|
|
57
|
-
imports: [
|
|
58
|
-
CommonModule,
|
|
59
|
-
],
|
|
60
|
-
exports: [
|
|
61
|
-
SmartClampPipe
|
|
62
|
-
]
|
|
63
|
-
}]
|
|
64
|
-
}], null, null); })();
|
|
65
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(SmartClampModule, { declarations: [SmartClampPipe], imports: [CommonModule], exports: [SmartClampPipe] }); })();
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Generated bundle index. Do not edit.
|
|
69
|
-
*/
|
|
70
|
-
|
|
71
|
-
export { SmartClampModule, SmartClampPipe };
|
|
72
|
-
//# sourceMappingURL=ng-atomic-common-pipes-smart-clamp.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ng-atomic-common-pipes-smart-clamp.mjs","sources":["../../../../libs/common/src/pipes/smart-clamp/smart-clamp.pipe.ts","../../../../libs/common/src/pipes/smart-clamp/smart-clamp.module.ts","../../../../libs/common/src/pipes/smart-clamp/ng-atomic-common-pipes-smart-clamp.ts"],"sourcesContent":["import { SlicePipe } from '@angular/common';\nimport { Inject, Optional, Pipe, PipeTransform } from '@angular/core';\nimport { smartSortByTransformer, SmartSortByTransformer, SMART_SORT_BY_TRANSFORMER } from '@ng-atomic/common/pipes/smart-sort-by';\nimport { EntitiesStore } from '@ng-atomic/common/stores/entities';\n\n@Pipe({\n name: 'smartClamp',\n pure: false,\n})\nexport class SmartClampPipe implements PipeTransform {\n private slicePipe = new SlicePipe();\n private _input: any = null;\n private _output: any = [];\n\n constructor(\n @Optional()\n @Inject(SMART_SORT_BY_TRANSFORMER)\n private transformer: SmartSortByTransformer,\n ) {\n this.transformer ??= smartSortByTransformer;\n }\n\n transform<T>(items: T[], store: EntitiesStore<any, any>): T[] {\n const input = {\n items, \n sortKey: store.sortKey, \n sortOrder: store.sortOrder, \n start: store.page.start,\n end: store.page.end,\n };\n \n if (JSON.stringify(input) === JSON.stringify(this._input)) {\n return this._output;\n }\n\n this._input = input;\n items = this.transformer(items, store?.sortKey, store?.sortOrder as 'asc' | 'desc');\n items = this.slicePipe.transform(items, store.page.start, store.page.end);\n return this._output = items;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SmartClampPipe } from './smart-clamp.pipe';\n\n\n\n@NgModule({\n declarations: [\n SmartClampPipe\n ],\n imports: [\n CommonModule,\n ],\n exports: [\n SmartClampPipe\n ]\n})\nexport class SmartClampModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MASa,cAAc,CAAA;AAKzB,IAAA,WAAA,CAGU,WAAmC,EAAA;QAAnC,IAAW,CAAA,WAAA,GAAX,WAAW,CAAwB;AAPrC,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;QAC5B,IAAM,CAAA,MAAA,GAAQ,IAAI,CAAC;QACnB,IAAO,CAAA,OAAA,GAAQ,EAAE,CAAC;QAOxB,IAAI,CAAC,WAAW,KAAhB,IAAI,CAAC,WAAW,GAAK,sBAAsB,CAAC,CAA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;;;MCCxB,gBAAgB,CAAA;;gFAAhB,gBAAgB,GAAA,CAAA,EAAA,CAAA;kEAAhB,gBAAgB,EAAA,CAAA,CAAA;sEANzB,YAAY,CAAA,EAAA,CAAA,CAAA;uFAMH,gBAAgB,EAAA,CAAA;cAX5B,QAAQ;AAAC,QAAA,IAAA,EAAA,CAAA;AACR,gBAAA,YAAY,EAAE;oBACZ,cAAc;AACf,iBAAA;AACD,gBAAA,OAAO,EAAE;oBACP,YAAY;AACb,iBAAA;AACD,gBAAA,OAAO,EAAE;oBACP,cAAc;AACf,iBAAA;AACF,aAAA,CAAA;;AACY,CAAA,YAAA,EAAA,CAAA,OAAA,SAAA,KAAA,WAAA,IAAA,SAAA,KAAA,EAAA,CAAA,kBAAA,CAAA,gBAAgB,EATzB,EAAA,YAAA,EAAA,CAAA,cAAc,CAGd,EAAA,OAAA,EAAA,CAAA,YAAY,aAGZ,cAAc,CAAA,EAAA,CAAA,CAAA,EAAA,GAAA;;ACdlB;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../libs/common/src/pipes/smart-clamp/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ng-atomic-common-pipes-smart-clamp.d.ts","sourceRoot":"","sources":["../../../../../libs/common/src/pipes/smart-clamp/ng-atomic-common-pipes-smart-clamp.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,cAAc,SAAS,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "./smart-clamp.pipe";
|
|
3
|
-
import * as i2 from "@angular/common";
|
|
4
|
-
export declare class SmartClampModule {
|
|
5
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SmartClampModule, never>;
|
|
6
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<SmartClampModule, [typeof i1.SmartClampPipe], [typeof i2.CommonModule], [typeof i1.SmartClampPipe]>;
|
|
7
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<SmartClampModule>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=smart-clamp.module.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"smart-clamp.module.d.ts","sourceRoot":"","sources":["../../../../../libs/common/src/pipes/smart-clamp/smart-clamp.module.ts"],"names":[],"mappings":";;;AAMA,qBAWa,gBAAgB;yCAAhB,gBAAgB;0CAAhB,gBAAgB;0CAAhB,gBAAgB;CAAI"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { PipeTransform } from '@angular/core';
|
|
2
|
-
import { SmartSortByTransformer } from '@ng-atomic/common/pipes/smart-sort-by';
|
|
3
|
-
import { EntitiesStore } from '@ng-atomic/common/stores/entities';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class SmartClampPipe implements PipeTransform {
|
|
6
|
-
private transformer;
|
|
7
|
-
private slicePipe;
|
|
8
|
-
private _input;
|
|
9
|
-
private _output;
|
|
10
|
-
constructor(transformer: SmartSortByTransformer);
|
|
11
|
-
transform<T>(items: T[], store: EntitiesStore<any, any>): T[];
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SmartClampPipe, [{ optional: true; }]>;
|
|
13
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<SmartClampPipe, "smartClamp", false>;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=smart-clamp.pipe.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"smart-clamp.pipe.d.ts","sourceRoot":"","sources":["../../../../../libs/common/src/pipes/smart-clamp/smart-clamp.pipe.ts"],"names":[],"mappings":"AACA,OAAO,EAA0B,aAAa,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAA0B,sBAAsB,EAA6B,MAAM,uCAAuC,CAAC;AAClI,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;;AAElE,qBAIa,cAAe,YAAW,aAAa;IAQhD,OAAO,CAAC,WAAW;IAPrB,OAAO,CAAC,SAAS,CAAmB;IACpC,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,OAAO,CAAW;gBAKhB,WAAW,EAAE,sBAAsB;IAK7C,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE;yCAblD,cAAc;uCAAd,cAAc;CA+B1B"}
|