@ng-atomic/common 5.12.0 → 5.14.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/models/action.mjs +7 -2
- package/esm2020/pipes/actions/actions.pipe.mjs +19 -0
- package/esm2020/pipes/actions/index.mjs +2 -0
- package/esm2020/pipes/actions/ng-atomic-common-pipes-actions.mjs +5 -0
- package/esm2020/pipes/data-accessor/data-accessor.pipe.mjs +1 -1
- package/esm2020/pipes/pagination/index.mjs +1 -2
- package/esm2020/pipes/pagination/pagination.module.mjs +4 -8
- package/esm2020/pipes/pagination/pagination.pipe.mjs +8 -4
- package/esm2020/pipes/select-id/select-id.pipe.mjs +2 -2
- package/esm2020/services/form/pagination/index.mjs +2 -0
- package/esm2020/services/form/pagination/ng-atomic-common-services-form-pagination.mjs +5 -0
- package/esm2020/services/form/pagination/pagination.service.mjs +24 -0
- package/esm2020/services/form/sort/index.mjs +2 -0
- package/esm2020/services/form/sort/ng-atomic-common-services-form-sort.mjs +5 -0
- package/esm2020/services/form/sort/sort.service.mjs +33 -0
- package/esm2020/services/loading/loading.service.mjs +3 -2
- package/esm2020/services/query-resolver/query-resolver.service.mjs +13 -5
- package/esm2020/stores/entities/entities.store.mjs +13 -8
- package/esm2020/utils/compare-by-id/compare-by-id.mjs +5 -2
- package/esm2020/utils/diff/diff.mjs +7 -0
- package/esm2020/utils/diff/index.mjs +2 -0
- package/esm2020/utils/index.mjs +2 -1
- package/fesm2015/ng-atomic-common-models.mjs +9 -0
- package/fesm2015/ng-atomic-common-models.mjs.map +1 -1
- package/fesm2015/ng-atomic-common-pipes-actions.mjs +26 -0
- package/fesm2015/ng-atomic-common-pipes-actions.mjs.map +1 -0
- package/fesm2015/ng-atomic-common-pipes-data-accessor.mjs.map +1 -1
- package/fesm2015/ng-atomic-common-pipes-pagination.mjs +7 -11
- package/fesm2015/ng-atomic-common-pipes-pagination.mjs.map +1 -1
- package/fesm2015/ng-atomic-common-pipes-select-id.mjs +1 -1
- package/fesm2015/ng-atomic-common-pipes-select-id.mjs.map +1 -1
- package/fesm2015/ng-atomic-common-services-form-pagination.mjs +31 -0
- package/fesm2015/ng-atomic-common-services-form-pagination.mjs.map +1 -0
- package/fesm2015/ng-atomic-common-services-form-sort.mjs +39 -0
- package/fesm2015/ng-atomic-common-services-form-sort.mjs.map +1 -0
- package/fesm2015/ng-atomic-common-services-loading.mjs +2 -1
- package/fesm2015/ng-atomic-common-services-loading.mjs.map +1 -1
- package/fesm2015/ng-atomic-common-services-query-resolver.mjs +13 -5
- package/fesm2015/ng-atomic-common-services-query-resolver.mjs.map +1 -1
- package/fesm2015/ng-atomic-common-stores-entities.mjs +12 -7
- package/fesm2015/ng-atomic-common-stores-entities.mjs.map +1 -1
- package/fesm2015/ng-atomic-common-utils.mjs +12 -2
- package/fesm2015/ng-atomic-common-utils.mjs.map +1 -1
- package/fesm2020/ng-atomic-common-models.mjs +9 -0
- package/fesm2020/ng-atomic-common-models.mjs.map +1 -1
- package/fesm2020/ng-atomic-common-pipes-actions.mjs +26 -0
- package/fesm2020/ng-atomic-common-pipes-actions.mjs.map +1 -0
- package/fesm2020/ng-atomic-common-pipes-data-accessor.mjs.map +1 -1
- package/fesm2020/ng-atomic-common-pipes-pagination.mjs +7 -11
- package/fesm2020/ng-atomic-common-pipes-pagination.mjs.map +1 -1
- package/fesm2020/ng-atomic-common-pipes-select-id.mjs +1 -1
- package/fesm2020/ng-atomic-common-pipes-select-id.mjs.map +1 -1
- package/fesm2020/ng-atomic-common-services-form-pagination.mjs +31 -0
- package/fesm2020/ng-atomic-common-services-form-pagination.mjs.map +1 -0
- package/fesm2020/ng-atomic-common-services-form-sort.mjs +39 -0
- package/fesm2020/ng-atomic-common-services-form-sort.mjs.map +1 -0
- package/fesm2020/ng-atomic-common-services-loading.mjs +2 -1
- package/fesm2020/ng-atomic-common-services-loading.mjs.map +1 -1
- package/fesm2020/ng-atomic-common-services-query-resolver.mjs +12 -4
- package/fesm2020/ng-atomic-common-services-query-resolver.mjs.map +1 -1
- package/fesm2020/ng-atomic-common-stores-entities.mjs +12 -7
- package/fesm2020/ng-atomic-common-stores-entities.mjs.map +1 -1
- package/fesm2020/ng-atomic-common-utils.mjs +12 -2
- package/fesm2020/ng-atomic-common-utils.mjs.map +1 -1
- package/models/action.d.ts +1 -0
- package/package.json +31 -2
- package/pipes/actions/actions.pipe.d.ts +6 -0
- package/pipes/actions/index.d.ts +1 -0
- package/pipes/data-accessor/data-accessor.pipe.d.ts +2 -2
- package/pipes/pagination/index.d.ts +0 -1
- package/pipes/pagination/pagination.module.d.ts +1 -2
- package/pipes/pagination/pagination.pipe.d.ts +15 -7
- package/services/form/pagination/index.d.ts +1 -0
- package/services/form/pagination/pagination.service.d.ts +16 -0
- package/services/form/sort/index.d.ts +1 -0
- package/services/form/sort/sort.service.d.ts +17 -0
- package/services/loading/loading.service.d.ts +1 -1
- package/services/query-resolver/query-resolver.service.d.ts +4 -3
- package/stores/entities/entities.store.d.ts +9 -9
- package/utils/compare-by-id/compare-by-id.d.ts +2 -1
- package/utils/diff/diff.d.ts +5 -0
- package/utils/diff/index.d.ts +1 -0
- package/utils/index.d.ts +1 -0
- package/esm2020/pipes/pagination/pagination.transformer.mjs +0 -5
- package/pipes/pagination/pagination.transformer.d.ts +0 -9
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import { InjectionToken, PipeTransform } from '@angular/core';
|
|
2
|
-
import { PaginationTransformer } from './pagination.transformer';
|
|
3
2
|
import * as i0 from "@angular/core";
|
|
3
|
+
interface Page {
|
|
4
|
+
start: number;
|
|
5
|
+
end: number;
|
|
6
|
+
key: string;
|
|
7
|
+
order: 'asc' | 'desc';
|
|
8
|
+
}
|
|
4
9
|
export declare const PAGINATION_TRANSFORMER: InjectionToken<unknown>;
|
|
10
|
+
export type PaginationTransformer<E> = (items: E[], page: Page) => E[];
|
|
11
|
+
export declare function paginationTransformer<E>(items: E[], page: Page): E[];
|
|
5
12
|
export declare class PaginationPipe<E> implements PipeTransform {
|
|
6
13
|
private transformer;
|
|
7
14
|
constructor(transformer: PaginationTransformer<E>);
|
|
8
|
-
transform(items: E[], { sortKey, sortOrder, start, end }
|
|
9
|
-
sortKey
|
|
10
|
-
sortOrder
|
|
11
|
-
start
|
|
12
|
-
end
|
|
15
|
+
transform(items: E[], { sortKey, sortOrder, start, end }?: {
|
|
16
|
+
sortKey?: string;
|
|
17
|
+
sortOrder?: 'asc' | 'desc';
|
|
18
|
+
start?: number;
|
|
19
|
+
end?: number;
|
|
13
20
|
}): E[];
|
|
14
21
|
static ɵfac: i0.ɵɵFactoryDeclaration<PaginationPipe<any>, [{ optional: true; }]>;
|
|
15
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<PaginationPipe<any>, "pagination",
|
|
22
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<PaginationPipe<any>, "pagination", true>;
|
|
16
23
|
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './pagination.service';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export interface PaginationFormValue {
|
|
3
|
+
pageSize: number;
|
|
4
|
+
pageIndex: number;
|
|
5
|
+
length: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class PaginationService {
|
|
8
|
+
private fb;
|
|
9
|
+
build({ pageSize, pageIndex, length, }?: Partial<PaginationFormValue>): import("@angular/forms").FormGroup<{
|
|
10
|
+
pageSize: import("@angular/forms").FormControl<number>;
|
|
11
|
+
pageIndex: import("@angular/forms").FormControl<number>;
|
|
12
|
+
length: import("@angular/forms").FormControl<number>;
|
|
13
|
+
}>;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PaginationService, never>;
|
|
15
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<PaginationService>;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sort.service';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export interface SortFormValue {
|
|
4
|
+
key?: string;
|
|
5
|
+
order?: 'asc' | 'desc';
|
|
6
|
+
}
|
|
7
|
+
export declare class SortService {
|
|
8
|
+
private fb;
|
|
9
|
+
constructor(fb: FormBuilder);
|
|
10
|
+
build({ key, order }?: Partial<SortFormValue>): FormGroup<{
|
|
11
|
+
key: FormControl<string>;
|
|
12
|
+
order: FormControl<"asc" | "desc">;
|
|
13
|
+
}>;
|
|
14
|
+
toggle(form: ReturnType<typeof this.build>, name: string): void;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SortService, never>;
|
|
16
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SortService>;
|
|
17
|
+
}
|
|
@@ -9,7 +9,7 @@ export declare class LoadingService {
|
|
|
9
9
|
setKey(key: string): void;
|
|
10
10
|
removeKey(key: string): void;
|
|
11
11
|
start(callback: (done: any) => void, key?: string): void;
|
|
12
|
-
await(callback: (...args: any[]) => Promise<
|
|
12
|
+
await<T = any>(callback: (...args: any[]) => Promise<T>): Promise<T>;
|
|
13
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<LoadingService, never>;
|
|
14
14
|
static ɵprov: i0.ɵɵInjectableDeclaration<LoadingService>;
|
|
15
15
|
}
|
|
@@ -2,8 +2,9 @@ import { SmartExpTransformer } from '@ng-atomic/common/utils';
|
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class QueryResolverService {
|
|
4
4
|
private transformer?;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
private map?;
|
|
6
|
+
constructor(transformer?: SmartExpTransformer, map?: Record<string, string>);
|
|
7
|
+
resolve<T>(items: T[], query: string, map?: Record<string, string>): T[];
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<QueryResolverService, [{ optional: true; }, { optional: true; }]>;
|
|
8
9
|
static ɵprov: i0.ɵɵInjectableDeclaration<QueryResolverService>;
|
|
9
10
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { ComponentStore } from '@ngrx/component-store';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
entities: E[];
|
|
5
|
-
}
|
|
2
|
+
import { ReplaySubject } from 'rxjs';
|
|
3
|
+
import { EntityState, EntityAdapter } from '@ngrx/entity';
|
|
6
4
|
export declare const distinctUntilChangedArray: <T>() => import("rxjs").MonoTypeOperatorFunction<T>;
|
|
7
5
|
export declare abstract class EntitiesStore<E extends {
|
|
8
6
|
id: string;
|
|
9
|
-
}, S extends
|
|
7
|
+
}, S extends EntityState<E> = any> extends ComponentStore<S> {
|
|
8
|
+
protected adapter: EntityAdapter<E>;
|
|
9
|
+
constructor(adapter?: EntityAdapter<E>);
|
|
10
10
|
protected readonly refresh$: ReplaySubject<void>;
|
|
11
|
+
protected readonly selectors: import("@ngrx/entity/src/models").EntitySelectors<E, EntityState<E>>;
|
|
11
12
|
get entities(): E[];
|
|
12
|
-
entities$: Observable<E[]>;
|
|
13
|
-
size$: Observable<number>;
|
|
14
|
-
|
|
15
|
-
setEntities: (observableOrValue: E[] | Observable<E[]>) => import("rxjs").Subscription;
|
|
13
|
+
entities$: import("rxjs").Observable<E[]>;
|
|
14
|
+
size$: import("rxjs").Observable<number>;
|
|
15
|
+
setEntities: (observableOrValue: E[] | import("rxjs").Observable<E[]>) => import("rxjs").Subscription;
|
|
16
16
|
abstract getEntities: ReturnType<typeof this.effect>;
|
|
17
17
|
refresh(): void;
|
|
18
18
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './diff';
|
package/utils/index.d.ts
CHANGED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { smartSortByTransformer } from '@ng-atomic/common/pipes/smart-sort-by';
|
|
2
|
-
export function paginationTransformer(items, page) {
|
|
3
|
-
return smartSortByTransformer(items, page.key, page.order).slice(page.start, page.end);
|
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