@recursyve/nice-data-filter-kit 14.3.0 → 14.3.2

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 (33) hide show
  1. package/esm2020/lib/components/nice-filter-view/components/advanced-filters/advanced-filters.component.mjs +19 -3
  2. package/esm2020/lib/components/nice-filter-view/components/advanced-filters/advanced-filters.form.mjs +4 -10
  3. package/esm2020/lib/components/nice-filter-view/components/advanced-filters/advanced-filters.module.mjs +8 -5
  4. package/esm2020/lib/components/nice-filter-view/components/advanced-filters/button/advanced-filters-button.component.mjs +6 -6
  5. package/esm2020/lib/components/nice-filter-view/components/advanced-filters/models/icons.model.mjs +4 -1
  6. package/esm2020/lib/components/nice-filter-view/components/advanced-filters/providers/async-typeahead.provider.mjs +32 -0
  7. package/esm2020/lib/components/nice-filter-view/components/advanced-filters/rule/components/select/select-filter.component.mjs +12 -43
  8. package/esm2020/lib/components/nice-filter-view/components/export-buttons/export-buttons.component.mjs +10 -7
  9. package/esm2020/lib/components/nice-filter-view/directives/query-params.directive.mjs +17 -10
  10. package/esm2020/lib/components/nice-filter-view/nice-base-filter-view.component.mjs +46 -12
  11. package/esm2020/lib/directive/selectable-list/providers/selectable-list-content.service.mjs +11 -1
  12. package/esm2020/lib/directive/selectable-list/selectable-list-checkbox.directive.mjs +10 -2
  13. package/esm2020/lib/directive/selectable-list/selectable-list.directive.mjs +55 -12
  14. package/esm2020/lib/directive/selectable-list/store/selectable-list-state.service.mjs +45 -16
  15. package/esm2020/lib/directive/selectable-list/store/selectable-list.service.mjs +10 -6
  16. package/fesm2015/recursyve-nice-data-filter-kit.mjs +251 -112
  17. package/fesm2015/recursyve-nice-data-filter-kit.mjs.map +1 -1
  18. package/fesm2020/recursyve-nice-data-filter-kit.mjs +246 -108
  19. package/fesm2020/recursyve-nice-data-filter-kit.mjs.map +1 -1
  20. package/lib/components/nice-filter-view/components/advanced-filters/advanced-filters.form.d.ts +0 -1
  21. package/lib/components/nice-filter-view/components/advanced-filters/advanced-filters.module.d.ts +1 -1
  22. package/lib/components/nice-filter-view/components/advanced-filters/button/advanced-filters-button.component.d.ts +3 -3
  23. package/lib/components/nice-filter-view/components/advanced-filters/models/icons.model.d.ts +1 -0
  24. package/lib/components/nice-filter-view/components/advanced-filters/providers/async-typeahead.provider.d.ts +18 -0
  25. package/lib/components/nice-filter-view/components/advanced-filters/rule/components/select/select-filter.component.d.ts +3 -11
  26. package/lib/components/nice-filter-view/components/export-buttons/export-buttons.component.d.ts +2 -1
  27. package/lib/components/nice-filter-view/directives/query-params.directive.d.ts +2 -1
  28. package/lib/components/nice-filter-view/nice-base-filter-view.component.d.ts +7 -0
  29. package/lib/directive/selectable-list/providers/selectable-list-content.service.d.ts +5 -0
  30. package/lib/directive/selectable-list/selectable-list.directive.d.ts +13 -4
  31. package/lib/directive/selectable-list/store/selectable-list-state.service.d.ts +12 -2
  32. package/lib/directive/selectable-list/store/selectable-list.service.d.ts +5 -2
  33. package/package.json +1 -1
@@ -6,7 +6,6 @@ export declare class FilterFormValues {
6
6
  export declare class FilterForm {
7
7
  id: string;
8
8
  operation: string;
9
- needsTwoValues: boolean;
10
9
  condition: Condition;
11
10
  values: FilterFormValues[];
12
11
  constructor(value: QueryModel | QueryRuleModel);
@@ -36,6 +36,6 @@ export interface NiceAdvancedFiltersOptions {
36
36
  export declare class NiceAdvancedFiltersModule {
37
37
  static forRoot(options?: NiceAdvancedFiltersOptions): ModuleWithProviders<NiceAdvancedFiltersModule>;
38
38
  static ɵfac: i0.ɵɵFactoryDeclaration<NiceAdvancedFiltersModule, never>;
39
- static ɵmod: i0.ɵɵNgModuleDeclaration<NiceAdvancedFiltersModule, [typeof i1.NiceAdvancedFiltersComponent, typeof i2.NiceAdvancedFiltersButtonComponent, typeof i3.NiceAdvancedFilterSelectionComponent, typeof i4.NiceAdvancedRuleComponent, typeof i5.NiceAdvancedDateFilterComponent, typeof i6.NiceAdvancedNumberFilterComponent, typeof i7.NiceAdvancedRadioFilterComponent, typeof i8.NiceAdvancedSelectFilterComponent, typeof i9.NiceAdvancedTextFilterComponent, typeof i10.AdvancedFiltersTriggerDirective, typeof i11.NiceFilterGroupIconPipe], [typeof i12.CommonModule, typeof i13.ReactiveFormsModule, typeof i14.MatRadioModule, typeof i15.MatCardModule, typeof i16.MatListModule, typeof i17.NiceLoadingSpinnerModule, typeof i18.MatIconModule, typeof i19.MatRippleModule, typeof i20.MatButtonModule, typeof i21.MatFormFieldModule, typeof i19.MatOptionModule, typeof i22.MatSelectModule, typeof i13.FormsModule, typeof i23.MatInputModule, typeof i24.MatButtonToggleModule, typeof i25.TranslateModule, typeof i26.MatDatepickerModule, typeof i17.NiceTypeaheadModule, typeof i27.NgxMaskModule], [typeof i1.NiceAdvancedFiltersComponent, typeof i2.NiceAdvancedFiltersButtonComponent, typeof i10.AdvancedFiltersTriggerDirective]>;
39
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NiceAdvancedFiltersModule, [typeof i1.NiceAdvancedFiltersComponent, typeof i2.NiceAdvancedFiltersButtonComponent, typeof i3.NiceAdvancedFilterSelectionComponent, typeof i4.NiceAdvancedRuleComponent, typeof i5.NiceAdvancedDateFilterComponent, typeof i6.NiceAdvancedNumberFilterComponent, typeof i7.NiceAdvancedRadioFilterComponent, typeof i8.NiceAdvancedSelectFilterComponent, typeof i9.NiceAdvancedTextFilterComponent, typeof i10.AdvancedFiltersTriggerDirective, typeof i11.NiceFilterGroupIconPipe], [typeof i12.CommonModule, typeof i13.ReactiveFormsModule, typeof i14.MatRadioModule, typeof i15.MatCardModule, typeof i16.MatListModule, typeof i17.NiceLoadingSpinnerModule, typeof i18.MatIconModule, typeof i19.MatRippleModule, typeof i20.MatButtonModule, typeof i21.MatFormFieldModule, typeof i19.MatOptionModule, typeof i22.MatSelectModule, typeof i13.FormsModule, typeof i23.MatInputModule, typeof i24.MatButtonToggleModule, typeof i25.TranslateModule, typeof i26.MatDatepickerModule, typeof i17.NiceTypeaheadModule, typeof i27.NgxMaskModule, typeof i17.NiceAsyncTypeaheadModule], [typeof i1.NiceAdvancedFiltersComponent, typeof i2.NiceAdvancedFiltersButtonComponent, typeof i10.AdvancedFiltersTriggerDirective]>;
40
40
  static ɵinj: i0.ɵɵInjectorDeclaration<NiceAdvancedFiltersModule>;
41
41
  }
@@ -1,15 +1,15 @@
1
1
  import { FilterConfigurationModel } from "../../../../../models/filter.model";
2
- import { NiceBaseIconOptions } from "../../../../base-list/models/icons.model";
3
2
  import { NiceFilterViewQuery } from "../../../store/nice-filter-view.query";
4
3
  import { NiceFilterViewService } from "../../../store/nice-filter-view.service";
4
+ import { NiceAdvancedFilterIconOptions } from "../models/icons.model";
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class NiceAdvancedFiltersButtonComponent {
7
- icons: NiceBaseIconOptions;
7
+ icons: NiceAdvancedFilterIconOptions;
8
8
  private query;
9
9
  private service;
10
10
  shouldShowAdvancedFilters$: import("rxjs").Observable<boolean>;
11
11
  hasParameters$: import("rxjs").Observable<boolean>;
12
- constructor(icons: NiceBaseIconOptions, query: NiceFilterViewQuery, service: NiceFilterViewService);
12
+ constructor(icons: NiceAdvancedFilterIconOptions, query: NiceFilterViewQuery, service: NiceFilterViewService);
13
13
  clickToggleShowAdvancedFilters(): void;
14
14
  onSelectedFilter(filter: FilterConfigurationModel): void;
15
15
  static ɵfac: i0.ɵɵFactoryDeclaration<NiceAdvancedFiltersButtonComponent, [{ optional: true; }, null, null]>;
@@ -6,5 +6,6 @@ export interface NiceAdvancedFilterIconOptions {
6
6
  delete?: NiceBaseListIcons;
7
7
  arrowDown?: NiceBaseListIcons;
8
8
  datePicker?: NiceBaseListIcons;
9
+ queryBuilder?: NiceBaseListIcons;
9
10
  }
10
11
  export declare const defaultIcons: NiceAdvancedFilterIconOptions;
@@ -0,0 +1,18 @@
1
+ import { NiceAsyncTypeaheadProvider, NiceAsyncTypeaheadSearchResult } from "@recursyve/nice-ui-kit.v2";
2
+ import { FilterConfigurationModel, SelectFilterValue } from "../../../../../models/filter.model";
3
+ import { NiceFilterService } from "../../../../base-list/providers/base-filter.service";
4
+ import * as i0 from "@angular/core";
5
+ interface AdvancedFiltersAsyncTypeaheadOptions {
6
+ filterConfig: FilterConfigurationModel;
7
+ }
8
+ export declare class AdvancedFiltersAsyncTypeaheadProvider extends NiceAsyncTypeaheadProvider<SelectFilterValue> {
9
+ private filterService;
10
+ resource: string;
11
+ constructor(filterService: NiceFilterService<any>);
12
+ getById(id: number, options: AdvancedFiltersAsyncTypeaheadOptions): Promise<SelectFilterValue>;
13
+ search(searchQuery: string, page: number, options: AdvancedFiltersAsyncTypeaheadOptions): Promise<NiceAsyncTypeaheadSearchResult<SelectFilterValue>>;
14
+ format(item: SelectFilterValue): string;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<AdvancedFiltersAsyncTypeaheadProvider, never>;
16
+ static ɵprov: i0.ɵɵInjectableDeclaration<AdvancedFiltersAsyncTypeaheadProvider>;
17
+ }
18
+ export {};
@@ -1,22 +1,14 @@
1
- import { OnChanges, OnDestroy, OnInit, SimpleChanges } from "@angular/core";
2
- import { Subject } from "rxjs";
1
+ import { OnChanges, OnInit, SimpleChanges } from "@angular/core";
3
2
  import { FilterConfigurationModel, SelectFilterValue } from "../../../../../../../models/filter.model";
4
- import { NiceFilterService } from "../../../../../../base-list/providers/base-filter.service";
5
3
  import { FilterComponent } from "../filter.component";
6
4
  import * as i0 from "@angular/core";
7
- export declare class NiceAdvancedSelectFilterComponent extends FilterComponent<unknown> implements OnInit, OnDestroy, OnChanges {
8
- protected filterService: NiceFilterService<any>;
5
+ export declare class NiceAdvancedSelectFilterComponent extends FilterComponent<unknown> implements OnInit, OnChanges {
9
6
  filterConfig: FilterConfigurationModel;
10
7
  values: SelectFilterValue[];
11
- search$: Subject<string>;
12
- private searchSub$;
13
- constructor(filterService: NiceFilterService<any>);
14
8
  ngOnInit(): Promise<void>;
15
9
  ngOnChanges(changes: SimpleChanges): void;
16
- private searchValue;
17
10
  onValueChange(value: unknown): void;
18
- ngOnDestroy(): void;
19
11
  writeValue(value: unknown): void;
20
- static ɵfac: i0.ɵɵFactoryDeclaration<NiceAdvancedSelectFilterComponent, [{ optional: true; }]>;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceAdvancedSelectFilterComponent, never>;
21
13
  static ɵcmp: i0.ɵɵComponentDeclaration<NiceAdvancedSelectFilterComponent, "nice-advanced-select-filter", never, { "filterConfig": "filterConfig"; }, {}, never, never, false>;
22
14
  }
@@ -13,6 +13,7 @@ export declare class NiceFilterExportButtonsComponent {
13
13
  private readonly bottomSheet;
14
14
  customExport: ExportStrategy[];
15
15
  downloadFileName: string;
16
+ canPrint: boolean;
16
17
  loading$: import("rxjs").Observable<boolean>;
17
18
  constructor(icons: NiceBaseIconOptions, exportsSettings: ExportSettings, query: NiceFilterViewQuery, service: NiceFilterViewService, bottomSheet: MatBottomSheet);
18
19
  clickExport(): void;
@@ -21,5 +22,5 @@ export declare class NiceFilterExportButtonsComponent {
21
22
  clickPrint(): void;
22
23
  clickPdf(): void;
23
24
  static ɵfac: i0.ɵɵFactoryDeclaration<NiceFilterExportButtonsComponent, never>;
24
- static ɵcmp: i0.ɵɵComponentDeclaration<NiceFilterExportButtonsComponent, "nice-filter-export-buttons, div[nice-filter-export-buttons]", never, { "customExport": "customExport"; "downloadFileName": "downloadFileName"; }, {}, never, never, false>;
25
+ static ɵcmp: i0.ɵɵComponentDeclaration<NiceFilterExportButtonsComponent, "nice-filter-export-buttons, div[nice-filter-export-buttons]", never, { "customExport": "customExport"; "downloadFileName": "downloadFileName"; "canPrint": "canPrint"; }, {}, never, never, false>;
25
26
  }
@@ -10,7 +10,8 @@ export declare class NiceFilterQueryParamsDirective implements OnInit, OnDestroy
10
10
  private router;
11
11
  init: EventEmitter<any>;
12
12
  private unsubscribeAll$;
13
- private initialized;
13
+ private _initialized;
14
+ get initialized(): boolean;
14
15
  constructor(query: NiceFilterViewQuery, service: NiceFilterViewService, route: ActivatedRoute, router: Router);
15
16
  ngOnInit(): void;
16
17
  ngOnDestroy(): void;
@@ -3,6 +3,8 @@ import { Observable } from "rxjs";
3
3
  import { QueryParams } from "../../api/filter.api";
4
4
  import { QueryModel, QueryRuleModel, RuleModel } from "../../models/query.model";
5
5
  import { NiceFilterService } from "../base-list/providers/base-filter.service";
6
+ import { NiceAdvancedFiltersButtonComponent } from "./components/advanced-filters/button/advanced-filters-button.component";
7
+ import { NiceFilterQueryParamsDirective } from "./directives/query-params.directive";
6
8
  import { NiceFilterViewQuery } from "./store/nice-filter-view.query";
7
9
  import { NiceFilterViewService } from "./store/nice-filter-view.service";
8
10
  import * as i0 from "@angular/core";
@@ -14,6 +16,9 @@ export interface NiceBaseFilterViewInitOptions {
14
16
  export declare abstract class NiceBaseFilterViewComponent<Filter extends NiceFilterService<any> = NiceFilterService<any>> implements OnInit {
15
17
  protected filterViewService: NiceFilterViewService<Filter>;
16
18
  protected filterViewQuery: NiceFilterViewQuery;
19
+ protected queryParams: NiceFilterQueryParamsDirective;
20
+ protected advancedFiltersButton: NiceAdvancedFiltersButtonComponent;
21
+ private advancedFilters;
17
22
  filterViewLoading$: Observable<boolean>;
18
23
  ngOnInit(autoLoad?: boolean, { mode, loadConfig, configQueryParams }?: NiceBaseFilterViewInitOptions): void;
19
24
  /**
@@ -51,6 +56,8 @@ export declare abstract class NiceBaseFilterViewComponent<Filter extends NiceFil
51
56
  * NOTE: This will only check for rules in the first element of the rules array in the current filterParameters.
52
57
  */
53
58
  removeRule(id: string, reload?: boolean): void;
59
+ private autoLoad;
60
+ private loadConfig;
54
61
  static ɵfac: i0.ɵɵFactoryDeclaration<NiceBaseFilterViewComponent<any>, never>;
55
62
  static ɵcmp: i0.ɵɵComponentDeclaration<NiceBaseFilterViewComponent<any>, "ng-component", never, {}, {}, never, never, false>;
56
63
  }
@@ -1,11 +1,16 @@
1
1
  import { QueryList } from "@angular/core";
2
+ import { NiceSelectableListOptions } from "../model/selectable-list-options.model";
2
3
  import { NiceSelectableListCheckboxDirective } from "../selectable-list-checkbox.directive";
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class SelectableListContentService {
6
+ private _options;
5
7
  private _state;
6
8
  private _checkboxes;
9
+ private defaultOptions;
10
+ get options(): NiceSelectableListOptions;
7
11
  get state(): string | null;
8
12
  get checkboxes(): QueryList<NiceSelectableListCheckboxDirective>;
13
+ setOptions(options: NiceSelectableListOptions): void;
9
14
  setState(state: string): void;
10
15
  setCheckboxes(checkboxes: QueryList<NiceSelectableListCheckboxDirective>): void;
11
16
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectableListContentService, never>;
@@ -1,18 +1,27 @@
1
- import { AfterContentInit, OnChanges, OnInit, QueryList, SimpleChanges } from "@angular/core";
1
+ import { AfterContentInit, OnChanges, OnDestroy, OnInit, QueryList, SimpleChanges } from "@angular/core";
2
+ import { ActivatedRoute } from "@angular/router";
2
3
  import { NiceSelectableListOptions } from "./model/selectable-list-options.model";
3
4
  import { SelectableListContentService } from "./providers/selectable-list-content.service";
4
5
  import { NiceSelectableListCheckboxDirective } from "./selectable-list-checkbox.directive";
6
+ import { SelectableListService } from "./store/selectable-list.service";
5
7
  import * as i0 from "@angular/core";
6
- export declare class NiceSelectableListDirective implements OnInit, OnChanges, AfterContentInit {
8
+ export declare class NiceSelectableListDirective implements OnInit, OnDestroy, OnChanges, AfterContentInit {
7
9
  private service;
10
+ private selectableListService;
11
+ private route;
8
12
  state: string;
9
13
  options: NiceSelectableListOptions;
10
14
  readonly checkboxes: QueryList<NiceSelectableListCheckboxDirective>;
11
- private defaultOptions;
12
- constructor(service: SelectableListContentService);
15
+ private unsubscribeAll$;
16
+ private unsubscribeQuerySub$;
17
+ private stateService;
18
+ private stateQuery;
19
+ constructor(service: SelectableListContentService, selectableListService: SelectableListService, route: ActivatedRoute);
13
20
  ngOnInit(): void;
21
+ ngOnDestroy(): void;
14
22
  ngOnChanges(changes: SimpleChanges): void;
15
23
  ngAfterContentInit(): void;
24
+ private listenOnStateChanges;
16
25
  static ɵfac: i0.ɵɵFactoryDeclaration<NiceSelectableListDirective, never>;
17
26
  static ɵdir: i0.ɵɵDirectiveDeclaration<NiceSelectableListDirective, "[niceSelectableList]", never, { "state": "state"; "options": "options"; }, {}, ["checkboxes"], never, false>;
18
27
  }
@@ -1,3 +1,4 @@
1
+ import { ActivatedRoute, Router } from "@angular/router";
1
2
  import { EntityStore } from "@datorama/akita";
2
3
  import { NiceSelectableListLoadAllEntitiesOptions } from "../model/load-all-entities-options.model";
3
4
  import { NiceSelectableListOptions } from "../model/selectable-list-options.model";
@@ -5,21 +6,25 @@ import { NicePreloadSelectedEntitiesProvider } from "../providers/preload-select
5
6
  import { SelectableListState } from "./selectable-list.state";
6
7
  export declare class SelectableListStateService<T, ID = any> {
7
8
  private store;
9
+ private route;
10
+ private router;
8
11
  private preloadService?;
9
12
  private options?;
10
13
  get idKey(): string;
11
14
  get preloadedWindow(): number;
12
- constructor(store: EntityStore<SelectableListState<any>>, preloadService?: NicePreloadSelectedEntitiesProvider<T>, options?: NiceSelectableListOptions);
15
+ constructor(store: EntityStore<SelectableListState<any>>, route: ActivatedRoute, router: Router, preloadService?: NicePreloadSelectedEntitiesProvider<T>, options?: NiceSelectableListOptions);
13
16
  setActive(entity: T): void;
14
17
  getIndex(identifier: number): number;
15
18
  selectAll(options?: NiceSelectableListLoadAllEntitiesOptions): Promise<void>;
16
19
  select(id: ID): Promise<void>;
20
+ selectMany(ids: ID[], active: ID): Promise<void>;
17
21
  selectEntity(entity: T): Promise<void>;
18
22
  selectManyEntities(entities: T[]): Promise<void>;
19
23
  unselectAll(): void;
20
24
  unselect(id: ID): void;
21
25
  unselectEntity(entity: T): void;
22
26
  unselectManyEntities(entities: T[]): void;
27
+ updateEntity(entity: T): void;
23
28
  setEntities(ids: ID[], activeId: ID): Promise<void>;
24
29
  next(): Promise<void>;
25
30
  previous(): Promise<void>;
@@ -27,6 +32,11 @@ export declare class SelectableListStateService<T, ID = any> {
27
32
  last(): Promise<void>;
28
33
  removeActive(): Promise<void>;
29
34
  loadActiveEntity(id: number, direction: number): Promise<void>;
30
- loadEntities(loadExtremity: any): Promise<void>;
35
+ loadEntities(loadExtremity: boolean): Promise<void>;
31
36
  getListIdToLoad(loadExtremity: boolean): number[];
37
+ generateQueryParams(): {
38
+ selection: number[] | null;
39
+ selected: number | null;
40
+ };
41
+ setQueryParams(): void;
32
42
  }
@@ -1,3 +1,4 @@
1
+ import { ActivatedRoute, Router } from "@angular/router";
1
2
  import { EntityStore } from "@datorama/akita";
2
3
  import { NiceSelectableListOptions } from "../model/selectable-list-options.model";
3
4
  import { NicePreloadSelectedEntitiesProvider } from "../providers/preload-selected-entities.provider";
@@ -7,8 +8,10 @@ import { SelectableListState } from "./selectable-list.state";
7
8
  import * as i0 from "@angular/core";
8
9
  export declare class SelectableListService {
9
10
  private providers;
11
+ private route;
12
+ private router;
10
13
  private stores;
11
- constructor(providers: NicePreloadSelectedEntitiesProvider<any>[]);
14
+ constructor(providers: NicePreloadSelectedEntitiesProvider<any>[], route: ActivatedRoute, router: Router);
12
15
  createState(name: string, options?: NiceSelectableListOptions): {
13
16
  store: EntityStore<SelectableListState<any, number>, any, number>;
14
17
  query: SelectableListStateQuery<any>;
@@ -19,6 +22,6 @@ export declare class SelectableListService {
19
22
  };
20
23
  withState<T, ID = any>(stateName: string, options?: NiceSelectableListOptions): SelectableListStateService<T, ID>;
21
24
  query<T>(stateName: string): SelectableListStateQuery<T>;
22
- static ɵfac: i0.ɵɵFactoryDeclaration<SelectableListService, [{ optional: true; }]>;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<SelectableListService, [{ optional: true; }, null, null]>;
23
26
  static ɵprov: i0.ɵɵInjectableDeclaration<SelectableListService>;
24
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@recursyve/nice-data-filter-kit",
3
- "version": "14.3.0",
3
+ "version": "14.3.2",
4
4
  "exports": {
5
5
  ".": {
6
6
  "sass": "./_index.scss",