@recursyve/nice-data-filter-kit 14.1.5 → 14.2.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.
Files changed (42) hide show
  1. package/esm2020/lib/components/nice-filter-view/components/infinite-scroll-data-view/infinite-scroll-data-view.component.mjs +2 -3
  2. package/esm2020/lib/components/nice-filter-view/directives/mat-paginator.mjs +2 -2
  3. package/esm2020/lib/components/nice-filter-view/store/nice-filter-view.query.mjs +4 -1
  4. package/esm2020/lib/components/nice-filter-view/store/nice-filter-view.service.mjs +4 -18
  5. package/esm2020/lib/components/nice-filter-view/store/nice-filter-view.store.mjs +15 -1
  6. package/esm2020/lib/directive/public-api.mjs +2 -0
  7. package/esm2020/lib/directive/selectable-list/model/load-all-entities-options.model.mjs +2 -0
  8. package/esm2020/lib/directive/selectable-list/model/selectable-list-options.model.mjs +2 -0
  9. package/esm2020/lib/directive/selectable-list/providers/preload-selected-entities.provider.mjs +10 -0
  10. package/esm2020/lib/directive/selectable-list/public-api.mjs +10 -0
  11. package/esm2020/lib/directive/selectable-list/selectable-list-checkbox.directive.mjs +122 -0
  12. package/esm2020/lib/directive/selectable-list/selectable-list-select-all.directive.mjs +48 -0
  13. package/esm2020/lib/directive/selectable-list/selectable-list.constant.mjs +3 -0
  14. package/esm2020/lib/directive/selectable-list/selectable-list.directive.mjs +38 -0
  15. package/esm2020/lib/directive/selectable-list/selectable-list.module.mjs +32 -0
  16. package/esm2020/lib/directive/selectable-list/store/selectable-list-state.service.mjs +181 -0
  17. package/esm2020/lib/directive/selectable-list/store/selectable-list.service.mjs +49 -0
  18. package/esm2020/lib/directive/selectable-list/store/selectable-list.state.mjs +2 -0
  19. package/esm2020/lib/utils/query-params.utils.mjs +2 -16
  20. package/esm2020/public-api.mjs +2 -1
  21. package/fesm2015/recursyve-nice-data-filter-kit.mjs +495 -33
  22. package/fesm2015/recursyve-nice-data-filter-kit.mjs.map +1 -1
  23. package/fesm2020/recursyve-nice-data-filter-kit.mjs +470 -36
  24. package/fesm2020/recursyve-nice-data-filter-kit.mjs.map +1 -1
  25. package/lib/components/nice-filter-view/store/nice-filter-view.query.d.ts +1 -0
  26. package/lib/components/nice-filter-view/store/nice-filter-view.service.d.ts +0 -1
  27. package/lib/components/nice-filter-view/store/nice-filter-view.store.d.ts +1 -0
  28. package/lib/directive/public-api.d.ts +1 -0
  29. package/lib/directive/selectable-list/model/load-all-entities-options.model.d.ts +4 -0
  30. package/lib/directive/selectable-list/model/selectable-list-options.model.d.ts +4 -0
  31. package/lib/directive/selectable-list/providers/preload-selected-entities.provider.d.ts +12 -0
  32. package/lib/directive/selectable-list/public-api.d.ts +9 -0
  33. package/lib/directive/selectable-list/selectable-list-checkbox.directive.d.ts +24 -0
  34. package/lib/directive/selectable-list/selectable-list-select-all.directive.d.ts +18 -0
  35. package/lib/directive/selectable-list/selectable-list.constant.d.ts +2 -0
  36. package/lib/directive/selectable-list/selectable-list.directive.d.ts +14 -0
  37. package/lib/directive/selectable-list/selectable-list.module.d.ts +12 -0
  38. package/lib/directive/selectable-list/store/selectable-list-state.service.d.ts +32 -0
  39. package/lib/directive/selectable-list/store/selectable-list.service.d.ts +23 -0
  40. package/lib/directive/selectable-list/store/selectable-list.state.d.ts +8 -0
  41. package/package.json +1 -1
  42. package/public-api.d.ts +1 -0
@@ -10,6 +10,7 @@ export declare class NiceFilterViewQuery extends QueryEntity<NiceFilterViewState
10
10
  selectFilterConfig(): Observable<FilterConfigurationModel[]>;
11
11
  selectFilterParameters(): Observable<FilterParametersModel>;
12
12
  selectFilterResult(): Observable<FilterResultModel | null>;
13
+ getParameters(): FilterParametersModel;
13
14
  static ɵfac: i0.ɵɵFactoryDeclaration<NiceFilterViewQuery, never>;
14
15
  static ɵprov: i0.ɵɵInjectableDeclaration<NiceFilterViewQuery>;
15
16
  }
@@ -30,7 +30,6 @@ export declare class NiceFilterViewService<Filter extends NiceFilterService<any>
30
30
  upsertValue(value: any, key?: string): void;
31
31
  removeValue(value: any, key?: string): void;
32
32
  resetResult(waitForNextFilter: boolean): void;
33
- getParameters(filterParameters?: FilterParametersModel): FilterParametersModel;
34
33
  static ɵfac: i0.ɵɵFactoryDeclaration<NiceFilterViewService<any>, never>;
35
34
  static ɵprov: i0.ɵɵInjectableDeclaration<NiceFilterViewService<any>>;
36
35
  }
@@ -27,6 +27,7 @@ export declare class NiceFilterViewStore extends EntityStore<NiceFilterViewState
27
27
  addValue(value: any, opts?: AddEntitiesOptions): void;
28
28
  upsertValue(value: any, key?: string): void;
29
29
  removeValue(value: any, key?: string): void;
30
+ getParameters(filterParameters?: FilterParametersModel): FilterParametersModel;
30
31
  static ɵfac: i0.ɵɵFactoryDeclaration<NiceFilterViewStore, never>;
31
32
  static ɵprov: i0.ɵɵInjectableDeclaration<NiceFilterViewStore>;
32
33
  }
@@ -0,0 +1 @@
1
+ export * from "./selectable-list/public-api";
@@ -0,0 +1,4 @@
1
+ import { FilterQueryModel } from "../../../models/filter.model";
2
+ export interface NiceSelectableListLoadAllEntitiesOptions {
3
+ query?: FilterQueryModel;
4
+ }
@@ -0,0 +1,4 @@
1
+ export interface NiceSelectableListOptions {
2
+ idKey?: string;
3
+ preloadWindow?: number;
4
+ }
@@ -0,0 +1,12 @@
1
+ import { NiceSelectableListLoadAllEntitiesOptions } from "../model/load-all-entities-options.model";
2
+ import * as i0 from "@angular/core";
3
+ export declare abstract class NicePreloadSelectedEntitiesProvider<T, ID = number> {
4
+ abstract state: string;
5
+ abstract reloadEntity(entity: T): Promise<T>;
6
+ abstract reloadEntities(entities: T[]): Promise<T[]>;
7
+ abstract loadEntityById(id: ID): Promise<T>;
8
+ abstract loadEntitiesById(ids: ID[]): Promise<T[]>;
9
+ abstract loadAllEntities(options?: NiceSelectableListLoadAllEntitiesOptions): Promise<ID[]>;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<NicePreloadSelectedEntitiesProvider<any, any>, never>;
11
+ static ɵprov: i0.ɵɵInjectableDeclaration<NicePreloadSelectedEntitiesProvider<any, any>>;
12
+ }
@@ -0,0 +1,9 @@
1
+ export * from "./model/selectable-list-options.model";
2
+ export * from "./model/load-all-entities-options.model";
3
+ export * from "./providers/preload-selected-entities.provider";
4
+ export * from "./store/selectable-list.service";
5
+ export * from "./store/selectable-list-state.service";
6
+ export * from "./selectable-list.module";
7
+ export * from "./selectable-list.directive";
8
+ export * from "./selectable-list-checkbox.directive";
9
+ export * from "./selectable-list-select-all.directive";
@@ -0,0 +1,24 @@
1
+ import { OnDestroy, OnInit } from "@angular/core";
2
+ import { MatCheckbox } from "@angular/material/checkbox";
3
+ import { NiceSelectableListDirective } from "./selectable-list.directive";
4
+ import { SelectableListService } from "./store/selectable-list.service";
5
+ import * as i0 from "@angular/core";
6
+ export declare class NiceSelectableListCheckboxDirective implements OnInit, OnDestroy {
7
+ readonly checkbox: MatCheckbox;
8
+ private selectableList;
9
+ private selectableListService;
10
+ selectableEntity?: any;
11
+ selectPage?: boolean;
12
+ private selectableListStateService;
13
+ private selectableListStateQuery;
14
+ private unsubscribeAll$;
15
+ private get currentId();
16
+ constructor(checkbox: MatCheckbox, selectableList: NiceSelectableListDirective, selectableListService: SelectableListService);
17
+ ngOnInit(): void;
18
+ ngOnDestroy(): void;
19
+ private handleSelectableEntity;
20
+ private handleSelectPage;
21
+ private updateCheckboxState;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceSelectableListCheckboxDirective, never>;
23
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NiceSelectableListCheckboxDirective, "mat-checkbox[niceSelectableListCheckbox]", never, { "selectableEntity": "selectableEntity"; "selectPage": "selectPage"; }, {}, never, never, false>;
24
+ }
@@ -0,0 +1,18 @@
1
+ import { OnInit } from "@angular/core";
2
+ import { NiceFilterViewQuery } from "../../components/nice-filter-view/store/nice-filter-view.query";
3
+ import { NiceSelectableListDirective } from "./selectable-list.directive";
4
+ import { SelectableListService } from "./store/selectable-list.service";
5
+ import * as i0 from "@angular/core";
6
+ export declare class NiceSelectableListSelectAllDirective implements OnInit {
7
+ private niceFilterViewQuery;
8
+ private selectableList;
9
+ private selectableListService;
10
+ action: "select" | "unselect";
11
+ private selectableListStateService;
12
+ private selectableListStateQuery;
13
+ constructor(niceFilterViewQuery: NiceFilterViewQuery | null, selectableList: NiceSelectableListDirective, selectableListService: SelectableListService);
14
+ ngOnInit(): void;
15
+ onClick(): void;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceSelectableListSelectAllDirective, [{ optional: true; }, null, null]>;
17
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NiceSelectableListSelectAllDirective, "button[niceSelectableListSelectAll]", never, { "action": "action"; }, {}, never, never, false>;
18
+ }
@@ -0,0 +1,2 @@
1
+ import { InjectionToken } from "@angular/core";
2
+ export declare const NICE_PRELOAD_SELECTED_ENTITIES_PROVIDER: InjectionToken<unknown>;
@@ -0,0 +1,14 @@
1
+ import { OnChanges, OnInit, QueryList, SimpleChanges } from "@angular/core";
2
+ import { NiceSelectableListOptions } from "./model/selectable-list-options.model";
3
+ import { NiceSelectableListCheckboxDirective } from "./selectable-list-checkbox.directive";
4
+ import * as i0 from "@angular/core";
5
+ export declare class NiceSelectableListDirective implements OnInit, OnChanges {
6
+ state: string;
7
+ options: NiceSelectableListOptions;
8
+ readonly checkboxes: QueryList<NiceSelectableListCheckboxDirective>;
9
+ private defaultOptions;
10
+ ngOnInit(): void;
11
+ ngOnChanges(changes: SimpleChanges): void;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceSelectableListDirective, never>;
13
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NiceSelectableListDirective, "[niceSelectableList]", never, { "state": "state"; "options": "options"; }, {}, ["checkboxes"], never, false>;
14
+ }
@@ -0,0 +1,12 @@
1
+ import { ModuleWithProviders, Type } from "@angular/core";
2
+ import { NicePreloadSelectedEntitiesProvider } from "./providers/preload-selected-entities.provider";
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "./selectable-list.directive";
5
+ import * as i2 from "./selectable-list-checkbox.directive";
6
+ import * as i3 from "./selectable-list-select-all.directive";
7
+ export declare class NiceSelectableListModule {
8
+ static register(...providers: Type<NicePreloadSelectedEntitiesProvider<any, any>>[]): ModuleWithProviders<NiceSelectableListModule>;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceSelectableListModule, never>;
10
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NiceSelectableListModule, [typeof i1.NiceSelectableListDirective, typeof i2.NiceSelectableListCheckboxDirective, typeof i3.NiceSelectableListSelectAllDirective], never, [typeof i1.NiceSelectableListDirective, typeof i2.NiceSelectableListCheckboxDirective, typeof i3.NiceSelectableListSelectAllDirective]>;
11
+ static ɵinj: i0.ɵɵInjectorDeclaration<NiceSelectableListModule>;
12
+ }
@@ -0,0 +1,32 @@
1
+ import { EntityStore } from "@datorama/akita";
2
+ import { NiceSelectableListLoadAllEntitiesOptions } from "../model/load-all-entities-options.model";
3
+ import { NiceSelectableListOptions } from "../model/selectable-list-options.model";
4
+ import { NicePreloadSelectedEntitiesProvider } from "../providers/preload-selected-entities.provider";
5
+ import { SelectableListState } from "./selectable-list.state";
6
+ export declare class SelectableListStateService<T, ID = any> {
7
+ private store;
8
+ private preloadService?;
9
+ private options?;
10
+ get idKey(): string;
11
+ get preloadedWindow(): number;
12
+ constructor(store: EntityStore<SelectableListState<any>>, preloadService?: NicePreloadSelectedEntitiesProvider<T>, options?: NiceSelectableListOptions);
13
+ setActive(entity: T): void;
14
+ getIndex(identifier: number): number;
15
+ selectAll(options?: NiceSelectableListLoadAllEntitiesOptions): Promise<void>;
16
+ select(id: ID): Promise<void>;
17
+ selectEntity(entity: T): Promise<void>;
18
+ selectManyEntities(entities: T[]): Promise<void>;
19
+ unselectAll(): void;
20
+ unselect(id: ID): void;
21
+ unselectEntity(entity: T): void;
22
+ unselectManyEntities(entities: T[]): void;
23
+ setEntities(ids: ID[], activeId: ID): Promise<void>;
24
+ next(): Promise<void>;
25
+ previous(): Promise<void>;
26
+ first(): Promise<void>;
27
+ last(): Promise<void>;
28
+ removeActive(): Promise<void>;
29
+ loadActiveEntity(id: number, direction: number): Promise<void>;
30
+ loadEntities(loadExtremity: any): Promise<void>;
31
+ getListIdToLoad(loadExtremity: boolean): number[];
32
+ }
@@ -0,0 +1,23 @@
1
+ import { EntityStore, QueryEntity } from "@datorama/akita";
2
+ import { NiceSelectableListOptions } from "../model/selectable-list-options.model";
3
+ import { NicePreloadSelectedEntitiesProvider } from "../providers/preload-selected-entities.provider";
4
+ import { SelectableListStateService } from "./selectable-list-state.service";
5
+ import { SelectableListState } from "./selectable-list.state";
6
+ import * as i0 from "@angular/core";
7
+ export declare class SelectableListService {
8
+ private providers;
9
+ private stores;
10
+ constructor(providers: NicePreloadSelectedEntitiesProvider<any>[]);
11
+ createState(name: string, options?: NiceSelectableListOptions): {
12
+ store: EntityStore<SelectableListState<any>, any, number>;
13
+ query: QueryEntity<SelectableListState<any>, any, number>;
14
+ };
15
+ getState(name: string): {
16
+ store: EntityStore<SelectableListState<any>, any, number>;
17
+ query: QueryEntity<SelectableListState<any>, any, number>;
18
+ };
19
+ withState<T, ID = any>(stateName: string, options?: NiceSelectableListOptions): SelectableListStateService<T, ID>;
20
+ query<T>(stateName: string): QueryEntity<SelectableListState<T>>;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<SelectableListService, [{ optional: true; }]>;
22
+ static ɵprov: i0.ɵɵInjectableDeclaration<SelectableListService>;
23
+ }
@@ -0,0 +1,8 @@
1
+ import { ActiveState, EntityState } from "@datorama/akita";
2
+ export declare type SelectableListEntity<T> = T & {
3
+ loaded?: boolean;
4
+ };
5
+ export interface SelectableListState<T> extends EntityState<SelectableListEntity<T>, number>, ActiveState<any> {
6
+ allSelected: boolean;
7
+ unselectedEntity: any[];
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@recursyve/nice-data-filter-kit",
3
- "version": "14.1.5",
3
+ "version": "14.2.0",
4
4
  "exports": {
5
5
  ".": {
6
6
  "sass": "./_index.scss",
package/public-api.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./lib/api/public-api";
2
2
  export * from "./lib/components/public-api";
3
+ export * from "./lib/directive/public-api";
3
4
  export * from "./lib/models/public-api";
4
5
  export * from "./lib/utils/public-api";