@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, __awaiter, __rest } from 'tslib';
11
11
  import * as i2 from '@angular/router';
@@ -566,7 +566,8 @@ class FilterUtils {
566
566
  rules: (_e = filterParameters.rules) !== null && _e !== void 0 ? _e : []
567
567
  },
568
568
  order: OrderUtils.combineOrders(filterParameters.order, filterParameters.fallbackOrder),
569
- data: filterParameters.data
569
+ data: filterParameters.data,
570
+ groupBy: filterParameters.groupBy
570
571
  };
571
572
  }
572
573
  static filterChangeNeedsRefresh(currentFilters, newFilters) {
@@ -2824,6 +2825,7 @@ const initialValue = {
2824
2825
  mode: "paginated",
2825
2826
  autoLoad: true,
2826
2827
  disabled: false,
2828
+ initialLoadCompleted: false,
2827
2829
  filterConfigLoading: false,
2828
2830
  filterConfig: [],
2829
2831
  filterResult: null,
@@ -2851,7 +2853,7 @@ class NiceFilterViewStore extends EntityStore {
2851
2853
  this.update({ filterParameters });
2852
2854
  }
2853
2855
  setResult(filterResult) {
2854
- const { mode, resetResult } = this.getValue();
2856
+ const { mode, resetResult, initialLoadCompleted } = this.getValue();
2855
2857
  if (mode === "accumulated") {
2856
2858
  this.update((state) => {
2857
2859
  var _a, _b;
@@ -2879,6 +2881,9 @@ class NiceFilterViewStore extends EntityStore {
2879
2881
  else {
2880
2882
  this.set([...filterResult.values]);
2881
2883
  }
2884
+ if (!initialLoadCompleted) {
2885
+ this.update({ initialLoadCompleted: true });
2886
+ }
2882
2887
  }
2883
2888
  addValue(value, opts) {
2884
2889
  const { filterResult } = this.getValue();
@@ -2890,6 +2895,16 @@ class NiceFilterViewStore extends EntityStore {
2890
2895
  });
2891
2896
  this.add(value, opts);
2892
2897
  }
2898
+ addValues(values, opts) {
2899
+ const { filterResult } = this.getValue();
2900
+ if (!filterResult) {
2901
+ return;
2902
+ }
2903
+ this.update({
2904
+ filterResult: Object.assign(Object.assign({}, filterResult), { values: arrayAdd(filterResult.values, values, opts) })
2905
+ });
2906
+ this.add(values, opts);
2907
+ }
2893
2908
  upsertValue(value, key) {
2894
2909
  const { filterResult } = this.getValue();
2895
2910
  if (!filterResult) {
@@ -2897,10 +2912,22 @@ class NiceFilterViewStore extends EntityStore {
2897
2912
  }
2898
2913
  const idKey = key !== null && key !== void 0 ? key : this.idKey;
2899
2914
  this.update({
2900
- filterResult: Object.assign(Object.assign({}, filterResult), { values: arrayUpsert(filterResult.values, value[idKey], value, key) })
2915
+ filterResult: Object.assign(Object.assign({}, filterResult), { values: arrayUpsert(filterResult.values, value[idKey], value, idKey) })
2901
2916
  });
2902
2917
  this.upsert(value[idKey], value);
2903
2918
  }
2919
+ upsertValues(values, key) {
2920
+ const idKey = key !== null && key !== void 0 ? key : this.idKey;
2921
+ for (const value of values) {
2922
+ this.update(({ filterResult }) => {
2923
+ var _a;
2924
+ return ({
2925
+ filterResult: Object.assign(Object.assign({}, (filterResult !== null && filterResult !== void 0 ? filterResult : { values: [] })), { values: arrayUpsert((_a = filterResult === null || filterResult === void 0 ? void 0 : filterResult.values) !== null && _a !== void 0 ? _a : [], value[idKey], value, idKey) })
2926
+ });
2927
+ });
2928
+ this.upsert(value[idKey], value);
2929
+ }
2930
+ }
2904
2931
  removeValue(value, key) {
2905
2932
  const { filterResult } = this.getValue();
2906
2933
  if (!filterResult) {
@@ -2908,10 +2935,22 @@ class NiceFilterViewStore extends EntityStore {
2908
2935
  }
2909
2936
  const idKey = key !== null && key !== void 0 ? key : this.idKey;
2910
2937
  this.update({
2911
- filterResult: Object.assign(Object.assign({}, filterResult), { values: arrayRemove(filterResult.values, value[idKey], key) })
2938
+ filterResult: Object.assign(Object.assign({}, filterResult), { values: arrayRemove(filterResult.values, value[idKey], idKey) })
2912
2939
  });
2913
2940
  this.remove(value[idKey]);
2914
2941
  }
2942
+ removeValues(values, key) {
2943
+ const { filterResult } = this.getValue();
2944
+ if (!filterResult) {
2945
+ return;
2946
+ }
2947
+ const idKey = key !== null && key !== void 0 ? key : this.idKey;
2948
+ const ids = values.map(value => value[idKey]);
2949
+ this.update({
2950
+ filterResult: Object.assign(Object.assign({}, filterResult), { values: arrayRemove(filterResult.values, ids) })
2951
+ });
2952
+ this.remove(ids);
2953
+ }
2915
2954
  getParameters(filterParameters) {
2916
2955
  const { baseRules } = this.getValue();
2917
2956
  const parameters = Object.assign(Object.assign({}, filterParameters), { rules: (filterParameters === null || filterParameters === void 0 ? void 0 : filterParameters.rules) ? [...filterParameters.rules] : [] });
@@ -2930,6 +2969,48 @@ class NiceFilterViewStore extends EntityStore {
2930
2969
  }
2931
2970
  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 });
2932
2971
  NiceFilterViewStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterViewStore });
2972
+ __decorate([
2973
+ transaction(),
2974
+ __metadata("design:type", Function),
2975
+ __metadata("design:paramtypes", [Object]),
2976
+ __metadata("design:returntype", void 0)
2977
+ ], NiceFilterViewStore.prototype, "setResult", null);
2978
+ __decorate([
2979
+ transaction(),
2980
+ __metadata("design:type", Function),
2981
+ __metadata("design:paramtypes", [Object, Object]),
2982
+ __metadata("design:returntype", void 0)
2983
+ ], NiceFilterViewStore.prototype, "addValue", null);
2984
+ __decorate([
2985
+ transaction(),
2986
+ __metadata("design:type", Function),
2987
+ __metadata("design:paramtypes", [Array, Object]),
2988
+ __metadata("design:returntype", void 0)
2989
+ ], NiceFilterViewStore.prototype, "addValues", null);
2990
+ __decorate([
2991
+ transaction(),
2992
+ __metadata("design:type", Function),
2993
+ __metadata("design:paramtypes", [Object, String]),
2994
+ __metadata("design:returntype", void 0)
2995
+ ], NiceFilterViewStore.prototype, "upsertValue", null);
2996
+ __decorate([
2997
+ transaction(),
2998
+ __metadata("design:type", Function),
2999
+ __metadata("design:paramtypes", [Array, String]),
3000
+ __metadata("design:returntype", void 0)
3001
+ ], NiceFilterViewStore.prototype, "upsertValues", null);
3002
+ __decorate([
3003
+ transaction(),
3004
+ __metadata("design:type", Function),
3005
+ __metadata("design:paramtypes", [Object, String]),
3006
+ __metadata("design:returntype", void 0)
3007
+ ], NiceFilterViewStore.prototype, "removeValue", null);
3008
+ __decorate([
3009
+ transaction(),
3010
+ __metadata("design:type", Function),
3011
+ __metadata("design:paramtypes", [Array, String]),
3012
+ __metadata("design:returntype", void 0)
3013
+ ], NiceFilterViewStore.prototype, "removeValues", null);
2933
3014
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterViewStore, decorators: [{
2934
3015
  type: Injectable
2935
3016
  }], ctorParameters: function () {
@@ -2940,7 +3021,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2940
3021
  type: Inject,
2941
3022
  args: [FILTER_VIEW_STORE]
2942
3023
  }] }];
2943
- } });
3024
+ }, propDecorators: { setResult: [], addValue: [], addValues: [], upsertValue: [], upsertValues: [], removeValue: [], removeValues: [] } });
2944
3025
 
2945
3026
  class NiceFilterViewQuery extends QueryEntity {
2946
3027
  constructor(store) {
@@ -3181,17 +3262,27 @@ class NiceFilterViewService {
3181
3262
  addValue(value, opts) {
3182
3263
  this.store.addValue(value, opts);
3183
3264
  }
3265
+ addValues(value, opts) {
3266
+ this.store.addValues(value, opts);
3267
+ }
3184
3268
  upsertValue(value, key) {
3185
3269
  this.store.upsertValue(value, key);
3186
3270
  }
3271
+ upsertValues(values, key) {
3272
+ this.store.upsertValues(values, key);
3273
+ }
3187
3274
  removeValue(value, key) {
3188
3275
  this.store.removeValue(value, key);
3189
3276
  }
3277
+ removeValues(values, key) {
3278
+ this.store.removeValues(values, key);
3279
+ }
3190
3280
  resetResult(waitForNextFilter) {
3191
3281
  if (!waitForNextFilter) {
3192
3282
  this.store.update({
3193
3283
  filterResult: null
3194
3284
  });
3285
+ this.store.set([]);
3195
3286
  }
3196
3287
  else {
3197
3288
  this.store.update({
@@ -3202,6 +3293,12 @@ class NiceFilterViewService {
3202
3293
  }
3203
3294
  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 });
3204
3295
  NiceFilterViewService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterViewService });
3296
+ __decorate([
3297
+ transaction(),
3298
+ __metadata("design:type", Function),
3299
+ __metadata("design:paramtypes", [Boolean]),
3300
+ __metadata("design:returntype", void 0)
3301
+ ], NiceFilterViewService.prototype, "resetResult", null);
3205
3302
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterViewService, decorators: [{
3206
3303
  type: Injectable
3207
3304
  }], ctorParameters: function () {
@@ -3209,7 +3306,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
3209
3306
  type: Inject,
3210
3307
  args: [NiceFilterService]
3211
3308
  }] }];
3212
- } });
3309
+ }, propDecorators: { resetResult: [] } });
3213
3310
 
3214
3311
  class NiceFilterGroupIconPipe {
3215
3312
  constructor(service) {
@@ -4026,6 +4123,10 @@ class NiceSelectableListStateService {
4026
4123
  var _a, _b;
4027
4124
  return (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.preloadWindow) !== null && _b !== void 0 ? _b : 2;
4028
4125
  }
4126
+ get queryParamsDisabled() {
4127
+ var _a, _b;
4128
+ return (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.disableQueryParams) !== null && _b !== void 0 ? _b : false;
4129
+ }
4029
4130
  constructor(store, route, router, preloadService, options) {
4030
4131
  this.store = store;
4031
4132
  this.route = route;
@@ -4246,10 +4347,12 @@ class NiceSelectableListStateService {
4246
4347
  };
4247
4348
  }
4248
4349
  setQueryParams() {
4249
- this.router.navigate([], {
4250
- queryParams: this.generateQueryParams(),
4251
- queryParamsHandling: "merge"
4252
- });
4350
+ if (!this.queryParamsDisabled) {
4351
+ this.router.navigate([], {
4352
+ queryParams: this.generateQueryParams(),
4353
+ queryParamsHandling: "merge"
4354
+ });
4355
+ }
4253
4356
  }
4254
4357
  }
4255
4358
 
@@ -4700,7 +4803,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
4700
4803
  type: Input
4701
4804
  }] } });
4702
4805
 
4703
- class SelectableListContentService {
4806
+ class NiceSelectableListContentService {
4704
4807
  constructor() {
4705
4808
  this._state = null;
4706
4809
  this._checkboxes = new QueryList();
@@ -4726,10 +4829,11 @@ class SelectableListContentService {
4726
4829
  this._checkboxes = checkboxes;
4727
4830
  }
4728
4831
  }
4729
- SelectableListContentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SelectableListContentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4730
- SelectableListContentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SelectableListContentService });
4731
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SelectableListContentService, decorators: [{
4732
- type: Injectable
4832
+ NiceSelectableListContentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListContentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4833
+ NiceSelectableListContentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListContentService, providedIn: "any" });
4834
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListContentService, decorators: [{
4835
+ type: Injectable,
4836
+ args: [{ providedIn: "any" }]
4733
4837
  }] });
4734
4838
 
4735
4839
  // tslint:disable-next-line:directive-class-suffix
@@ -4844,14 +4948,14 @@ class NiceSelectableListCheckboxDirective {
4844
4948
  }
4845
4949
  }
4846
4950
  }
4847
- 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 });
4951
+ 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 });
4848
4952
  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 });
4849
4953
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListCheckboxDirective, decorators: [{
4850
4954
  type: Directive,
4851
4955
  args: [{
4852
4956
  selector: "mat-checkbox[niceSelectableListCheckbox]"
4853
4957
  }]
4854
- }], ctorParameters: function () { return [{ type: i1$4.MatCheckbox }, { type: SelectableListContentService }, { type: NiceSelectableListService }]; }, propDecorators: { selectableEntity: [{
4958
+ }], ctorParameters: function () { return [{ type: i1$4.MatCheckbox }, { type: NiceSelectableListContentService }, { type: NiceSelectableListService }]; }, propDecorators: { selectableEntity: [{
4855
4959
  type: Input
4856
4960
  }], selectPage: [{
4857
4961
  type: Input
@@ -4867,6 +4971,10 @@ class NiceSelectableListDirective {
4867
4971
  this.unsubscribeQuerySub$ = new Subject();
4868
4972
  }
4869
4973
  ngOnInit() {
4974
+ var _a;
4975
+ if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.disableQueryParams) {
4976
+ return;
4977
+ }
4870
4978
  combineLatest([
4871
4979
  this.route.queryParams.pipe(map((params) => params.selection), distinct()),
4872
4980
  this.route.queryParams.pipe(map((params) => params.selected), distinct())
@@ -4899,7 +5007,7 @@ class NiceSelectableListDirective {
4899
5007
  }
4900
5008
  if ("state" in changes) {
4901
5009
  this.service.setState(this.state);
4902
- this.stateService = this.selectableListService.withState(this.state);
5010
+ this.stateService = this.selectableListService.withState(this.state, this.options);
4903
5011
  this.stateQuery = this.selectableListService.query(this.state);
4904
5012
  this.listenOnStateChanges();
4905
5013
  }
@@ -4919,15 +5027,15 @@ class NiceSelectableListDirective {
4919
5027
  this.stateQuery.selectActiveId().pipe(takeUntil(this.unsubscribeQuerySub$)).subscribe(() => this.stateService.setQueryParams());
4920
5028
  }
4921
5029
  }
4922
- 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 });
4923
- 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 });
5030
+ 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 });
5031
+ 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 });
4924
5032
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListDirective, decorators: [{
4925
5033
  type: Directive,
4926
5034
  args: [{
4927
5035
  selector: "[niceSelectableList]",
4928
- providers: [SelectableListContentService]
5036
+ providers: [NiceSelectableListContentService]
4929
5037
  }]
4930
- }], ctorParameters: function () { return [{ type: SelectableListContentService }, { type: NiceSelectableListService }, { type: i2.ActivatedRoute }]; }, propDecorators: { state: [{
5038
+ }], ctorParameters: function () { return [{ type: NiceSelectableListContentService }, { type: NiceSelectableListService }, { type: i2.ActivatedRoute }]; }, propDecorators: { state: [{
4931
5039
  type: Input
4932
5040
  }], options: [{
4933
5041
  type: Input
@@ -4944,6 +5052,7 @@ class NiceBaseFilterViewComponent {
4944
5052
  this.autoLoad(autoLoad);
4945
5053
  this.loadConfig(loadConfig, configQueryParams);
4946
5054
  this.filterViewLoading$ = this.filterViewQuery.selectLoading();
5055
+ this.filterViewCount$ = this.filterViewQuery.selectCount();
4947
5056
  if (this.selectableListDirective) {
4948
5057
  this.filterViewService.updateSubState("selectable", { stateName: this.selectableListDirective.state });
4949
5058
  }
@@ -5219,7 +5328,7 @@ class NiceSelectableListSelectAllDirective {
5219
5328
  }
5220
5329
  }
5221
5330
  }
5222
- 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 });
5331
+ 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 });
5223
5332
  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 });
5224
5333
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListSelectAllDirective, decorators: [{
5225
5334
  type: Directive,
@@ -5229,7 +5338,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
5229
5338
  }], ctorParameters: function () {
5230
5339
  return [{ type: NiceFilterViewQuery, decorators: [{
5231
5340
  type: Optional
5232
- }] }, { type: SelectableListContentService }, { type: NiceSelectableListService }];
5341
+ }] }, { type: NiceSelectableListContentService }, { type: NiceSelectableListService }];
5233
5342
  }, propDecorators: { action: [{
5234
5343
  type: Input
5235
5344
  }], onClick: [{
@@ -5237,6 +5346,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
5237
5346
  args: ["click"]
5238
5347
  }] } });
5239
5348
 
5349
+ class NiceSelectableListIsEmptyDirectiveContext {
5350
+ }
5351
+ // tslint:disable-next-line:directive-selector
5352
+ class NiceSelectableListIsEmptyDirective {
5353
+ constructor(templateRef, viewContainerRef, contentService, selectableListService) {
5354
+ this.templateRef = templateRef;
5355
+ this.viewContainerRef = viewContainerRef;
5356
+ this.contentService = contentService;
5357
+ this.selectableListService = selectableListService;
5358
+ this.context = new NiceSelectableListIsEmptyDirectiveContext();
5359
+ this.embeddedViewRef = null;
5360
+ this.unsubscribeAll$ = new Subject();
5361
+ }
5362
+ static ngTemplateContextGuard(directive, ctx) {
5363
+ return true;
5364
+ }
5365
+ ngOnInit() {
5366
+ const state = this.contentService.state;
5367
+ const query = this.selectableListService.query(state);
5368
+ this.context.$implicit = this.context.isEmpty = (query.getCount() === 0);
5369
+ if (!this.embeddedViewRef) {
5370
+ this.viewContainerRef.clear();
5371
+ this.embeddedViewRef = this.viewContainerRef.createEmbeddedView(this.templateRef, this.context);
5372
+ }
5373
+ query.selectCount().pipe(takeUntil(this.unsubscribeAll$), map((count) => count === 0), distinctUntilChanged()).subscribe((isEmpty) => {
5374
+ this.context.$implicit = this.context.isEmpty = isEmpty;
5375
+ this.embeddedViewRef.context = this.context;
5376
+ this.embeddedViewRef.markForCheck();
5377
+ });
5378
+ }
5379
+ ngOnDestroy() {
5380
+ this.unsubscribeAll$.next();
5381
+ this.unsubscribeAll$.complete();
5382
+ }
5383
+ }
5384
+ 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 });
5385
+ NiceSelectableListIsEmptyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: NiceSelectableListIsEmptyDirective, selector: "[niceSelectableListIsEmpty]", ngImport: i0 });
5386
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListIsEmptyDirective, decorators: [{
5387
+ type: Directive,
5388
+ args: [{ selector: "[niceSelectableListIsEmpty]" }]
5389
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: NiceSelectableListContentService }, { type: NiceSelectableListService }]; } });
5390
+
5240
5391
  class NiceSelectableListModule {
5241
5392
  static register(...providers) {
5242
5393
  return {
@@ -5250,14 +5401,14 @@ class NiceSelectableListModule {
5250
5401
  }
5251
5402
  }
5252
5403
  NiceSelectableListModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
5253
- NiceSelectableListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListModule, declarations: [NiceSelectableListDirective, NiceSelectableListCheckboxDirective, NiceSelectableListSelectAllDirective], exports: [NiceSelectableListDirective, NiceSelectableListCheckboxDirective, NiceSelectableListSelectAllDirective] });
5404
+ 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] });
5254
5405
  NiceSelectableListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListModule });
5255
5406
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceSelectableListModule, decorators: [{
5256
5407
  type: NgModule,
5257
5408
  args: [{
5258
5409
  imports: [],
5259
- declarations: [NiceSelectableListDirective, NiceSelectableListCheckboxDirective, NiceSelectableListSelectAllDirective],
5260
- exports: [NiceSelectableListDirective, NiceSelectableListCheckboxDirective, NiceSelectableListSelectAllDirective]
5410
+ declarations: [NiceSelectableListDirective, NiceSelectableListCheckboxDirective, NiceSelectableListSelectAllDirective, NiceSelectableListIsEmptyDirective],
5411
+ exports: [NiceSelectableListDirective, NiceSelectableListCheckboxDirective, NiceSelectableListSelectAllDirective, NiceSelectableListIsEmptyDirective]
5261
5412
  }]
5262
5413
  }] });
5263
5414
 
@@ -5277,5 +5428,5 @@ String.prototype.toTableColumn = function (sortableOrOptions, nullLast) {
5277
5428
  * Generated bundle index. Do not edit.
5278
5429
  */
5279
5430
 
5280
- 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 };
5431
+ 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 };
5281
5432
  //# sourceMappingURL=recursyve-nice-data-filter-kit.mjs.map