@recursyve/nice-data-filter-kit 15.0.1 → 15.1.1

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 (32) hide show
  1. package/esm2020/lib/components/nice-filter-view/nice-base-filter-view.component.mjs +2 -1
  2. package/esm2020/lib/components/nice-filter-view/store/nice-filter-view.service.mjs +20 -2
  3. package/esm2020/lib/components/nice-filter-view/store/nice-filter-view.store.mjs +93 -6
  4. package/esm2020/lib/directive/selectable-list/model/selectable-list-options.model.mjs +1 -1
  5. package/esm2020/lib/directive/selectable-list/providers/selectable-list-content.service.mjs +7 -6
  6. package/esm2020/lib/directive/selectable-list/public-api.mjs +2 -1
  7. package/esm2020/lib/directive/selectable-list/selectable-list-checkbox.directive.mjs +4 -4
  8. package/esm2020/lib/directive/selectable-list/selectable-list-select-all.directive.mjs +4 -4
  9. package/esm2020/lib/directive/selectable-list/selectable-list-state.directive.mjs +50 -0
  10. package/esm2020/lib/directive/selectable-list/selectable-list.directive.mjs +10 -7
  11. package/esm2020/lib/directive/selectable-list/selectable-list.module.mjs +5 -4
  12. package/esm2020/lib/directive/selectable-list/store/selectable-list-state.service.mjs +10 -5
  13. package/esm2020/lib/models/filter.model.mjs +1 -1
  14. package/esm2020/lib/utils/filter.utils.mjs +3 -2
  15. package/fesm2015/recursyve-nice-data-filter-kit.mjs +180 -29
  16. package/fesm2015/recursyve-nice-data-filter-kit.mjs.map +1 -1
  17. package/fesm2020/recursyve-nice-data-filter-kit.mjs +184 -29
  18. package/fesm2020/recursyve-nice-data-filter-kit.mjs.map +1 -1
  19. package/lib/components/nice-filter-view/nice-base-filter-view.component.d.ts +1 -0
  20. package/lib/components/nice-filter-view/store/nice-filter-view.service.d.ts +4 -1
  21. package/lib/components/nice-filter-view/store/nice-filter-view.store.d.ts +4 -0
  22. package/lib/directive/selectable-list/model/selectable-list-options.model.d.ts +1 -0
  23. package/lib/directive/selectable-list/providers/selectable-list-content.service.d.ts +3 -3
  24. package/lib/directive/selectable-list/public-api.d.ts +1 -0
  25. package/lib/directive/selectable-list/selectable-list-checkbox.directive.d.ts +2 -2
  26. package/lib/directive/selectable-list/selectable-list-select-all.directive.d.ts +2 -2
  27. package/lib/directive/selectable-list/selectable-list-state.directive.d.ts +24 -0
  28. package/lib/directive/selectable-list/selectable-list.directive.d.ts +2 -2
  29. package/lib/directive/selectable-list/selectable-list.module.d.ts +2 -1
  30. package/lib/directive/selectable-list/store/selectable-list-state.service.d.ts +1 -0
  31. package/lib/models/filter.model.d.ts +2 -0
  32. package/package.json +1 -1
@@ -5,7 +5,7 @@ import * as i5$1 from '@recursyve/nice-ui-kit.v2';
5
5
  import { isNullOrUndefined, ObjectUtils, FileUtils, ArrayUtils, ExportBottomSheetComponent, NiceLoadingSpinnerModule, NiceTypeaheadModule, NiceExportBottomSheetModule, NiceAsyncTypeaheadProvider, NICE_ASYNC_TYPEAHEAD_PROVIDER, NiceAsyncTypeaheadModule } from '@recursyve/nice-ui-kit.v2';
6
6
  import * as i0 from '@angular/core';
7
7
  import { Directive, Input, NgModule, Injectable, Inject, InjectionToken, Optional, Pipe, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Output, HostListener, forwardRef, TemplateRef, ContentChild, ContentChildren, QueryList, ViewChild } from '@angular/core';
8
- import { Store, StoreConfig, Query, arrayAdd, arrayUpsert, arrayRemove, EntityStore, QueryEntity, EntityActions } from '@datorama/akita';
8
+ import { Store, StoreConfig, Query, arrayAdd, arrayUpsert, arrayRemove, EntityStore, transaction, QueryEntity, EntityActions } from '@datorama/akita';
9
9
  import { combineLatest, Subject, firstValueFrom, of, lastValueFrom, startWith, tap, distinct, take } from 'rxjs';
10
10
  import { __decorate, __metadata } from 'tslib';
11
11
  import * as i2 from '@angular/router';
@@ -571,7 +571,8 @@ class FilterUtils {
571
571
  rules: filterParameters.rules ?? []
572
572
  },
573
573
  order: OrderUtils.combineOrders(filterParameters.order, filterParameters.fallbackOrder),
574
- data: filterParameters.data
574
+ data: filterParameters.data,
575
+ groupBy: filterParameters.groupBy
575
576
  };
576
577
  }
577
578
  static filterChangeNeedsRefresh(currentFilters, newFilters) {
@@ -2755,6 +2756,7 @@ const initialValue = {
2755
2756
  mode: "paginated",
2756
2757
  autoLoad: true,
2757
2758
  disabled: false,
2759
+ initialLoadCompleted: false,
2758
2760
  filterConfigLoading: false,
2759
2761
  filterConfig: [],
2760
2762
  filterResult: null,
@@ -2788,7 +2790,7 @@ class NiceFilterViewStore extends EntityStore {
2788
2790
  this.update({ filterParameters });
2789
2791
  }
2790
2792
  setResult(filterResult) {
2791
- const { mode, resetResult } = this.getValue();
2793
+ const { mode, resetResult, initialLoadCompleted } = this.getValue();
2792
2794
  if (mode === "accumulated") {
2793
2795
  this.update((state) => ({
2794
2796
  filterResult: {
@@ -2813,6 +2815,9 @@ class NiceFilterViewStore extends EntityStore {
2813
2815
  else {
2814
2816
  this.set([...filterResult.values]);
2815
2817
  }
2818
+ if (!initialLoadCompleted) {
2819
+ this.update({ initialLoadCompleted: true });
2820
+ }
2816
2821
  }
2817
2822
  addValue(value, opts) {
2818
2823
  const { filterResult } = this.getValue();
@@ -2827,6 +2832,19 @@ class NiceFilterViewStore extends EntityStore {
2827
2832
  });
2828
2833
  this.add(value, opts);
2829
2834
  }
2835
+ addValues(values, opts) {
2836
+ const { filterResult } = this.getValue();
2837
+ if (!filterResult) {
2838
+ return;
2839
+ }
2840
+ this.update({
2841
+ filterResult: {
2842
+ ...filterResult,
2843
+ values: arrayAdd(filterResult.values, values, opts)
2844
+ }
2845
+ });
2846
+ this.add(values, opts);
2847
+ }
2830
2848
  upsertValue(value, key) {
2831
2849
  const { filterResult } = this.getValue();
2832
2850
  if (!filterResult) {
@@ -2836,11 +2854,23 @@ class NiceFilterViewStore extends EntityStore {
2836
2854
  this.update({
2837
2855
  filterResult: {
2838
2856
  ...filterResult,
2839
- values: arrayUpsert(filterResult.values, value[idKey], value, key)
2857
+ values: arrayUpsert(filterResult.values, value[idKey], value, idKey)
2840
2858
  }
2841
2859
  });
2842
2860
  this.upsert(value[idKey], value);
2843
2861
  }
2862
+ upsertValues(values, key) {
2863
+ const idKey = key ?? this.idKey;
2864
+ for (const value of values) {
2865
+ this.update(({ filterResult }) => ({
2866
+ filterResult: {
2867
+ ...(filterResult ?? { values: [] }),
2868
+ values: arrayUpsert(filterResult?.values ?? [], value[idKey], value, idKey)
2869
+ }
2870
+ }));
2871
+ this.upsert(value[idKey], value);
2872
+ }
2873
+ }
2844
2874
  removeValue(value, key) {
2845
2875
  const { filterResult } = this.getValue();
2846
2876
  if (!filterResult) {
@@ -2850,11 +2880,26 @@ class NiceFilterViewStore extends EntityStore {
2850
2880
  this.update({
2851
2881
  filterResult: {
2852
2882
  ...filterResult,
2853
- values: arrayRemove(filterResult.values, value[idKey], key)
2883
+ values: arrayRemove(filterResult.values, value[idKey], idKey)
2854
2884
  }
2855
2885
  });
2856
2886
  this.remove(value[idKey]);
2857
2887
  }
2888
+ removeValues(values, key) {
2889
+ const { filterResult } = this.getValue();
2890
+ if (!filterResult) {
2891
+ return;
2892
+ }
2893
+ const idKey = key ?? this.idKey;
2894
+ const ids = values.map(value => value[idKey]);
2895
+ this.update({
2896
+ filterResult: {
2897
+ ...filterResult,
2898
+ values: arrayRemove(filterResult.values, ids)
2899
+ }
2900
+ });
2901
+ this.remove(ids);
2902
+ }
2858
2903
  getParameters(filterParameters) {
2859
2904
  const { baseRules } = this.getValue();
2860
2905
  const parameters = {
@@ -2876,6 +2921,48 @@ class NiceFilterViewStore extends EntityStore {
2876
2921
  }
2877
2922
  NiceFilterViewStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterViewStore, deps: [{ token: FILTER_VIEW_STATE }, { token: FILTER_VIEW_STORE }], target: i0.ɵɵFactoryTarget.Injectable });
2878
2923
  NiceFilterViewStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterViewStore });
2924
+ __decorate([
2925
+ transaction(),
2926
+ __metadata("design:type", Function),
2927
+ __metadata("design:paramtypes", [Object]),
2928
+ __metadata("design:returntype", void 0)
2929
+ ], NiceFilterViewStore.prototype, "setResult", null);
2930
+ __decorate([
2931
+ transaction(),
2932
+ __metadata("design:type", Function),
2933
+ __metadata("design:paramtypes", [Object, Object]),
2934
+ __metadata("design:returntype", void 0)
2935
+ ], NiceFilterViewStore.prototype, "addValue", null);
2936
+ __decorate([
2937
+ transaction(),
2938
+ __metadata("design:type", Function),
2939
+ __metadata("design:paramtypes", [Array, Object]),
2940
+ __metadata("design:returntype", void 0)
2941
+ ], NiceFilterViewStore.prototype, "addValues", null);
2942
+ __decorate([
2943
+ transaction(),
2944
+ __metadata("design:type", Function),
2945
+ __metadata("design:paramtypes", [Object, String]),
2946
+ __metadata("design:returntype", void 0)
2947
+ ], NiceFilterViewStore.prototype, "upsertValue", null);
2948
+ __decorate([
2949
+ transaction(),
2950
+ __metadata("design:type", Function),
2951
+ __metadata("design:paramtypes", [Array, String]),
2952
+ __metadata("design:returntype", void 0)
2953
+ ], NiceFilterViewStore.prototype, "upsertValues", null);
2954
+ __decorate([
2955
+ transaction(),
2956
+ __metadata("design:type", Function),
2957
+ __metadata("design:paramtypes", [Object, String]),
2958
+ __metadata("design:returntype", void 0)
2959
+ ], NiceFilterViewStore.prototype, "removeValue", null);
2960
+ __decorate([
2961
+ transaction(),
2962
+ __metadata("design:type", Function),
2963
+ __metadata("design:paramtypes", [Array, String]),
2964
+ __metadata("design:returntype", void 0)
2965
+ ], NiceFilterViewStore.prototype, "removeValues", null);
2879
2966
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterViewStore, decorators: [{
2880
2967
  type: Injectable
2881
2968
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
@@ -2884,7 +2971,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2884
2971
  }] }, { type: undefined, decorators: [{
2885
2972
  type: Inject,
2886
2973
  args: [FILTER_VIEW_STORE]
2887
- }] }]; } });
2974
+ }] }]; }, propDecorators: { setResult: [], addValue: [], addValues: [], upsertValue: [], upsertValues: [], removeValue: [], removeValues: [] } });
2888
2975
 
2889
2976
  class NiceFilterViewQuery extends QueryEntity {
2890
2977
  constructor(store) {
@@ -3127,17 +3214,27 @@ class NiceFilterViewService {
3127
3214
  addValue(value, opts) {
3128
3215
  this.store.addValue(value, opts);
3129
3216
  }
3217
+ addValues(value, opts) {
3218
+ this.store.addValues(value, opts);
3219
+ }
3130
3220
  upsertValue(value, key) {
3131
3221
  this.store.upsertValue(value, key);
3132
3222
  }
3223
+ upsertValues(values, key) {
3224
+ this.store.upsertValues(values, key);
3225
+ }
3133
3226
  removeValue(value, key) {
3134
3227
  this.store.removeValue(value, key);
3135
3228
  }
3229
+ removeValues(values, key) {
3230
+ this.store.removeValues(values, key);
3231
+ }
3136
3232
  resetResult(waitForNextFilter) {
3137
3233
  if (!waitForNextFilter) {
3138
3234
  this.store.update({
3139
3235
  filterResult: null
3140
3236
  });
3237
+ this.store.set([]);
3141
3238
  }
3142
3239
  else {
3143
3240
  this.store.update({
@@ -3148,12 +3245,18 @@ class NiceFilterViewService {
3148
3245
  }
3149
3246
  NiceFilterViewService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterViewService, deps: [{ token: NiceFilterViewStore }, { token: NiceFilterService }], target: i0.ɵɵFactoryTarget.Injectable });
3150
3247
  NiceFilterViewService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterViewService });
3248
+ __decorate([
3249
+ transaction(),
3250
+ __metadata("design:type", Function),
3251
+ __metadata("design:paramtypes", [Boolean]),
3252
+ __metadata("design:returntype", void 0)
3253
+ ], NiceFilterViewService.prototype, "resetResult", null);
3151
3254
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterViewService, decorators: [{
3152
3255
  type: Injectable
3153
3256
  }], ctorParameters: function () { return [{ type: NiceFilterViewStore }, { type: undefined, decorators: [{
3154
3257
  type: Inject,
3155
3258
  args: [NiceFilterService]
3156
- }] }]; } });
3259
+ }] }]; }, propDecorators: { resetResult: [] } });
3157
3260
 
3158
3261
  class AdvancedFiltersUtils {
3159
3262
  static isSingleInput(filterOperator) {
@@ -4030,6 +4133,9 @@ class NiceSelectableListStateService {
4030
4133
  get preloadedWindow() {
4031
4134
  return this.options?.preloadWindow ?? 2;
4032
4135
  }
4136
+ get queryParamsDisabled() {
4137
+ return this.options?.disableQueryParams ?? false;
4138
+ }
4033
4139
  constructor(store, route, router, preloadService, options) {
4034
4140
  this.store = store;
4035
4141
  this.route = route;
@@ -4225,10 +4331,12 @@ class NiceSelectableListStateService {
4225
4331
  };
4226
4332
  }
4227
4333
  setQueryParams() {
4228
- this.router.navigate([], {
4229
- queryParams: this.generateQueryParams(),
4230
- queryParamsHandling: "merge"
4231
- });
4334
+ if (!this.queryParamsDisabled) {
4335
+ this.router.navigate([], {
4336
+ queryParams: this.generateQueryParams(),
4337
+ queryParamsHandling: "merge"
4338
+ });
4339
+ }
4232
4340
  }
4233
4341
  }
4234
4342
 
@@ -4689,7 +4797,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
4689
4797
  type: Input
4690
4798
  }] } });
4691
4799
 
4692
- class SelectableListContentService {
4800
+ class NiceSelectableListContentService {
4693
4801
  constructor() {
4694
4802
  this._state = null;
4695
4803
  this._checkboxes = new QueryList();
@@ -4717,10 +4825,11 @@ class SelectableListContentService {
4717
4825
  this._checkboxes = checkboxes;
4718
4826
  }
4719
4827
  }
4720
- SelectableListContentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SelectableListContentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4721
- SelectableListContentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SelectableListContentService });
4722
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SelectableListContentService, decorators: [{
4723
- type: Injectable
4828
+ NiceSelectableListContentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListContentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4829
+ NiceSelectableListContentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListContentService, providedIn: "any" });
4830
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListContentService, decorators: [{
4831
+ type: Injectable,
4832
+ args: [{ providedIn: "any" }]
4724
4833
  }] });
4725
4834
 
4726
4835
  // tslint:disable-next-line:directive-class-suffix
@@ -4835,14 +4944,14 @@ class NiceSelectableListCheckboxDirective {
4835
4944
  }
4836
4945
  }
4837
4946
  }
4838
- NiceSelectableListCheckboxDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListCheckboxDirective, deps: [{ token: i1$4.MatCheckbox }, { token: SelectableListContentService }, { token: NiceSelectableListService }], target: i0.ɵɵFactoryTarget.Directive });
4947
+ NiceSelectableListCheckboxDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListCheckboxDirective, deps: [{ token: i1$4.MatCheckbox }, { token: NiceSelectableListContentService }, { token: NiceSelectableListService }], target: i0.ɵɵFactoryTarget.Directive });
4839
4948
  NiceSelectableListCheckboxDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: NiceSelectableListCheckboxDirective, selector: "mat-checkbox[niceSelectableListCheckbox]", inputs: { selectableEntity: "selectableEntity", selectPage: "selectPage" }, ngImport: i0 });
4840
4949
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListCheckboxDirective, decorators: [{
4841
4950
  type: Directive,
4842
4951
  args: [{
4843
4952
  selector: "mat-checkbox[niceSelectableListCheckbox]"
4844
4953
  }]
4845
- }], ctorParameters: function () { return [{ type: i1$4.MatCheckbox }, { type: SelectableListContentService }, { type: NiceSelectableListService }]; }, propDecorators: { selectableEntity: [{
4954
+ }], ctorParameters: function () { return [{ type: i1$4.MatCheckbox }, { type: NiceSelectableListContentService }, { type: NiceSelectableListService }]; }, propDecorators: { selectableEntity: [{
4846
4955
  type: Input
4847
4956
  }], selectPage: [{
4848
4957
  type: Input
@@ -4858,6 +4967,9 @@ class NiceSelectableListDirective {
4858
4967
  this.unsubscribeQuerySub$ = new Subject();
4859
4968
  }
4860
4969
  ngOnInit() {
4970
+ if (this.options?.disableQueryParams) {
4971
+ return;
4972
+ }
4861
4973
  combineLatest([
4862
4974
  this.route.queryParams.pipe(map((params) => params.selection), distinct()),
4863
4975
  this.route.queryParams.pipe(map((params) => params.selected), distinct())
@@ -4890,7 +5002,7 @@ class NiceSelectableListDirective {
4890
5002
  }
4891
5003
  if ("state" in changes) {
4892
5004
  this.service.setState(this.state);
4893
- this.stateService = this.selectableListService.withState(this.state);
5005
+ this.stateService = this.selectableListService.withState(this.state, this.options);
4894
5006
  this.stateQuery = this.selectableListService.query(this.state);
4895
5007
  this.listenOnStateChanges();
4896
5008
  }
@@ -4910,15 +5022,15 @@ class NiceSelectableListDirective {
4910
5022
  this.stateQuery.selectActiveId().pipe(takeUntil(this.unsubscribeQuerySub$)).subscribe(() => this.stateService.setQueryParams());
4911
5023
  }
4912
5024
  }
4913
- NiceSelectableListDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListDirective, deps: [{ token: SelectableListContentService }, { token: NiceSelectableListService }, { token: i2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Directive });
4914
- NiceSelectableListDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: NiceSelectableListDirective, selector: "[niceSelectableList]", inputs: { state: "state", options: "options" }, providers: [SelectableListContentService], queries: [{ propertyName: "checkboxes", predicate: NiceSelectableListCheckboxDirective, descendants: true }], usesOnChanges: true, ngImport: i0 });
5025
+ NiceSelectableListDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListDirective, deps: [{ token: NiceSelectableListContentService }, { token: NiceSelectableListService }, { token: i2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Directive });
5026
+ NiceSelectableListDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: NiceSelectableListDirective, selector: "[niceSelectableList]", inputs: { state: "state", options: "options" }, providers: [NiceSelectableListContentService], queries: [{ propertyName: "checkboxes", predicate: NiceSelectableListCheckboxDirective, descendants: true }], usesOnChanges: true, ngImport: i0 });
4915
5027
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListDirective, decorators: [{
4916
5028
  type: Directive,
4917
5029
  args: [{
4918
5030
  selector: "[niceSelectableList]",
4919
- providers: [SelectableListContentService]
5031
+ providers: [NiceSelectableListContentService]
4920
5032
  }]
4921
- }], ctorParameters: function () { return [{ type: SelectableListContentService }, { type: NiceSelectableListService }, { type: i2.ActivatedRoute }]; }, propDecorators: { state: [{
5033
+ }], ctorParameters: function () { return [{ type: NiceSelectableListContentService }, { type: NiceSelectableListService }, { type: i2.ActivatedRoute }]; }, propDecorators: { state: [{
4922
5034
  type: Input
4923
5035
  }], options: [{
4924
5036
  type: Input
@@ -4935,6 +5047,7 @@ class NiceBaseFilterViewComponent {
4935
5047
  this.autoLoad(autoLoad);
4936
5048
  this.loadConfig(loadConfig, configQueryParams);
4937
5049
  this.filterViewLoading$ = this.filterViewQuery.selectLoading();
5050
+ this.filterViewCount$ = this.filterViewQuery.selectCount();
4938
5051
  if (this.selectableListDirective) {
4939
5052
  this.filterViewService.updateSubState("selectable", { stateName: this.selectableListDirective.state });
4940
5053
  }
@@ -5210,7 +5323,7 @@ class NiceSelectableListSelectAllDirective {
5210
5323
  }
5211
5324
  }
5212
5325
  }
5213
- NiceSelectableListSelectAllDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListSelectAllDirective, deps: [{ token: NiceFilterViewQuery, optional: true }, { token: SelectableListContentService }, { token: NiceSelectableListService }], target: i0.ɵɵFactoryTarget.Directive });
5326
+ NiceSelectableListSelectAllDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListSelectAllDirective, deps: [{ token: NiceFilterViewQuery, optional: true }, { token: NiceSelectableListContentService }, { token: NiceSelectableListService }], target: i0.ɵɵFactoryTarget.Directive });
5214
5327
  NiceSelectableListSelectAllDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: NiceSelectableListSelectAllDirective, selector: "button[niceSelectableListSelectAll]", inputs: { action: "action" }, host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
5215
5328
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListSelectAllDirective, decorators: [{
5216
5329
  type: Directive,
@@ -5219,13 +5332,55 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
5219
5332
  }]
5220
5333
  }], ctorParameters: function () { return [{ type: NiceFilterViewQuery, decorators: [{
5221
5334
  type: Optional
5222
- }] }, { type: SelectableListContentService }, { type: NiceSelectableListService }]; }, propDecorators: { action: [{
5335
+ }] }, { type: NiceSelectableListContentService }, { type: NiceSelectableListService }]; }, propDecorators: { action: [{
5223
5336
  type: Input
5224
5337
  }], onClick: [{
5225
5338
  type: HostListener,
5226
5339
  args: ["click"]
5227
5340
  }] } });
5228
5341
 
5342
+ class NiceSelectableListIsEmptyDirectiveContext {
5343
+ }
5344
+ // tslint:disable-next-line:directive-selector
5345
+ class NiceSelectableListIsEmptyDirective {
5346
+ constructor(templateRef, viewContainerRef, contentService, selectableListService) {
5347
+ this.templateRef = templateRef;
5348
+ this.viewContainerRef = viewContainerRef;
5349
+ this.contentService = contentService;
5350
+ this.selectableListService = selectableListService;
5351
+ this.context = new NiceSelectableListIsEmptyDirectiveContext();
5352
+ this.embeddedViewRef = null;
5353
+ this.unsubscribeAll$ = new Subject();
5354
+ }
5355
+ static ngTemplateContextGuard(directive, ctx) {
5356
+ return true;
5357
+ }
5358
+ ngOnInit() {
5359
+ const state = this.contentService.state;
5360
+ const query = this.selectableListService.query(state);
5361
+ this.context.$implicit = this.context.isEmpty = (query.getCount() === 0);
5362
+ if (!this.embeddedViewRef) {
5363
+ this.viewContainerRef.clear();
5364
+ this.embeddedViewRef = this.viewContainerRef.createEmbeddedView(this.templateRef, this.context);
5365
+ }
5366
+ query.selectCount().pipe(takeUntil(this.unsubscribeAll$), map((count) => count === 0), distinctUntilChanged()).subscribe((isEmpty) => {
5367
+ this.context.$implicit = this.context.isEmpty = isEmpty;
5368
+ this.embeddedViewRef.context = this.context;
5369
+ this.embeddedViewRef.markForCheck();
5370
+ });
5371
+ }
5372
+ ngOnDestroy() {
5373
+ this.unsubscribeAll$.next();
5374
+ this.unsubscribeAll$.complete();
5375
+ }
5376
+ }
5377
+ NiceSelectableListIsEmptyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListIsEmptyDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: NiceSelectableListContentService }, { token: NiceSelectableListService }], target: i0.ɵɵFactoryTarget.Directive });
5378
+ NiceSelectableListIsEmptyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: NiceSelectableListIsEmptyDirective, selector: "[niceSelectableListIsEmpty]", ngImport: i0 });
5379
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListIsEmptyDirective, decorators: [{
5380
+ type: Directive,
5381
+ args: [{ selector: "[niceSelectableListIsEmpty]" }]
5382
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: NiceSelectableListContentService }, { type: NiceSelectableListService }]; } });
5383
+
5229
5384
  class NiceSelectableListModule {
5230
5385
  static register(...providers) {
5231
5386
  return {
@@ -5239,14 +5394,14 @@ class NiceSelectableListModule {
5239
5394
  }
5240
5395
  }
5241
5396
  NiceSelectableListModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
5242
- NiceSelectableListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListModule, declarations: [NiceSelectableListDirective, NiceSelectableListCheckboxDirective, NiceSelectableListSelectAllDirective], exports: [NiceSelectableListDirective, NiceSelectableListCheckboxDirective, NiceSelectableListSelectAllDirective] });
5397
+ NiceSelectableListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListModule, declarations: [NiceSelectableListDirective, NiceSelectableListCheckboxDirective, NiceSelectableListSelectAllDirective, NiceSelectableListIsEmptyDirective], exports: [NiceSelectableListDirective, NiceSelectableListCheckboxDirective, NiceSelectableListSelectAllDirective, NiceSelectableListIsEmptyDirective] });
5243
5398
  NiceSelectableListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListModule });
5244
5399
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListModule, decorators: [{
5245
5400
  type: NgModule,
5246
5401
  args: [{
5247
5402
  imports: [],
5248
- declarations: [NiceSelectableListDirective, NiceSelectableListCheckboxDirective, NiceSelectableListSelectAllDirective],
5249
- exports: [NiceSelectableListDirective, NiceSelectableListCheckboxDirective, NiceSelectableListSelectAllDirective]
5403
+ declarations: [NiceSelectableListDirective, NiceSelectableListCheckboxDirective, NiceSelectableListSelectAllDirective, NiceSelectableListIsEmptyDirective],
5404
+ exports: [NiceSelectableListDirective, NiceSelectableListCheckboxDirective, NiceSelectableListSelectAllDirective, NiceSelectableListIsEmptyDirective]
5250
5405
  }]
5251
5406
  }] });
5252
5407
 
@@ -5266,5 +5421,5 @@ String.prototype.toTableColumn = function (sortableOrOptions, nullLast) {
5266
5421
  * Generated bundle index. Do not edit.
5267
5422
  */
5268
5423
 
5269
- export { AdvancedFiltersForm, AdvancedFiltersTriggerDirective, DateFilterComponent, FilterComponent$1 as FilterComponent, FilterForm, FilterFormValues, FilterGroupIconPipe, FilterOperatorTypes, FilterSelectionComponent, FilterType, FilterUtils, LayoutContent, NiceAdvancedFiltersButtonComponent, NiceAdvancedFiltersComponent, NiceAdvancedFiltersModule, NiceBaseFilterViewComponent, NiceBaseListButtonsDirective, NiceBaseListCardsDirective, NiceBaseListComponent, NiceBaseListCustomContentDirective, NiceBaseListDirectiveModule, NiceBaseListEmptySearchResultStateDirective, NiceBaseListEmptyStateDirective, NiceBaseListFiltersDirective, NiceBaseListModule, NiceBaseListQuery, NiceBaseListService, NiceBaseListStore, NiceBaseListTableDirective, NiceBaseListTitleDirective, NiceCustomDateAdapter, NiceFilterApi, NiceFilterCustomDataViewComponent, NiceFilterDataDirective, NiceFilterExportButtonsComponent, NiceFilterExportDirective, NiceFilterGroupService, NiceFilterInfiniteScrollDataViewComponent, NiceFilterMatPaginatorPaginationDirective, NiceFilterMatSortSortingDirective, NiceFilterMatTableViewDirective, NiceFilterQueryParamsDirective, NiceFilterSearchComponent, NiceFilterService, NiceFilterViewComponent, NiceFilterViewModule, NiceFilterViewQuery, NiceFilterViewService, NiceListState, NiceMultiStateFilterService, NiceMultiStateListComponent, NiceMultiStateListModule, NiceMultiStateListQuery, NiceMultiStateListService, NiceMultiStateListStore, NicePreloadSelectedEntitiesProvider, NiceQueryBuilderComponent, NiceQueryBuilderModule, NiceSavedReportService, NiceSelectableListCheckboxDirective, NiceSelectableListDirective, NiceSelectableListModule, NiceSelectableListSelectAllDirective, NiceSelectableListService, NiceSelectableListStateQuery, NiceSelectableListStateService, NumberFilterComponent, OrderUtils, QBFilterUtils, QueryBuilderTriggerDirective, RadioFilterComponent, RuleComponent, SelectFilterComponent, StringUtils, TableColumns, TextFilterComponent, defaultLayout, initialBaseListState, initialValue$1 as initialValue, mixinNiceFilterApi };
5424
+ export { AdvancedFiltersForm, AdvancedFiltersTriggerDirective, DateFilterComponent, FilterComponent$1 as FilterComponent, FilterForm, FilterFormValues, FilterGroupIconPipe, FilterOperatorTypes, FilterSelectionComponent, FilterType, FilterUtils, LayoutContent, NiceAdvancedFiltersButtonComponent, NiceAdvancedFiltersComponent, NiceAdvancedFiltersModule, NiceBaseFilterViewComponent, NiceBaseListButtonsDirective, NiceBaseListCardsDirective, NiceBaseListComponent, NiceBaseListCustomContentDirective, NiceBaseListDirectiveModule, NiceBaseListEmptySearchResultStateDirective, NiceBaseListEmptyStateDirective, NiceBaseListFiltersDirective, NiceBaseListModule, NiceBaseListQuery, NiceBaseListService, NiceBaseListStore, NiceBaseListTableDirective, NiceBaseListTitleDirective, NiceCustomDateAdapter, NiceFilterApi, NiceFilterCustomDataViewComponent, NiceFilterDataDirective, NiceFilterExportButtonsComponent, NiceFilterExportDirective, NiceFilterGroupService, NiceFilterInfiniteScrollDataViewComponent, NiceFilterMatPaginatorPaginationDirective, NiceFilterMatSortSortingDirective, NiceFilterMatTableViewDirective, NiceFilterQueryParamsDirective, NiceFilterSearchComponent, NiceFilterService, NiceFilterViewComponent, NiceFilterViewModule, NiceFilterViewQuery, NiceFilterViewService, NiceListState, NiceMultiStateFilterService, NiceMultiStateListComponent, NiceMultiStateListModule, NiceMultiStateListQuery, NiceMultiStateListService, NiceMultiStateListStore, NicePreloadSelectedEntitiesProvider, NiceQueryBuilderComponent, NiceQueryBuilderModule, NiceSavedReportService, NiceSelectableListCheckboxDirective, NiceSelectableListDirective, NiceSelectableListIsEmptyDirective, NiceSelectableListModule, NiceSelectableListSelectAllDirective, NiceSelectableListService, NiceSelectableListStateQuery, NiceSelectableListStateService, NumberFilterComponent, OrderUtils, QBFilterUtils, QueryBuilderTriggerDirective, RadioFilterComponent, RuleComponent, SelectFilterComponent, StringUtils, TableColumns, TextFilterComponent, defaultLayout, initialBaseListState, initialValue$1 as initialValue, mixinNiceFilterApi };
5270
5425
  //# sourceMappingURL=recursyve-nice-data-filter-kit.mjs.map