@recursyve/nice-data-filter-kit 14.5.0 → 14.5.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.
@@ -1,5 +1,5 @@
1
1
  import { plainToInstance } from 'class-transformer';
2
- import { map, takeUntil, debounceTime, switchMap, distinctUntilChanged, withLatestFrom } from 'rxjs/operators';
2
+ import { map, takeUntil, debounceTime, switchMap, distinctUntilChanged, combineLatestWith } from 'rxjs/operators';
3
3
  import { HttpParams } from '@angular/common/http';
4
4
  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';
@@ -2748,72 +2748,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImpor
2748
2748
  }]
2749
2749
  }] });
2750
2750
 
2751
- class AdvancedFiltersUtils {
2752
- static isSingleInput(filterOperator) {
2753
- if (!filterOperator) {
2754
- return false;
2755
- }
2756
- return AdvancedFiltersUtils.singleInputOperators.includes(filterOperator);
2757
- }
2758
- static isDoubleInput(filterOperator) {
2759
- if (!filterOperator) {
2760
- return false;
2761
- }
2762
- return AdvancedFiltersUtils.doubleInputOperators.includes(filterOperator);
2763
- }
2764
- static isNoInput(filterOperator) {
2765
- if (!filterOperator) {
2766
- return false;
2767
- }
2768
- return AdvancedFiltersUtils.noInputOperators.includes(filterOperator);
2769
- }
2770
- static createRule(config, operator) {
2771
- var _a, _b, _c;
2772
- const base = {
2773
- id: config.id,
2774
- operation: operator || config.operators[0].id
2775
- };
2776
- switch (config.type) {
2777
- case FilterType.Text:
2778
- return Object.assign(Object.assign({}, base), { value: AdvancedFiltersUtils.isDoubleInput(operator) ? ["", ""] : "" });
2779
- case FilterType.Number:
2780
- case FilterType.Select:
2781
- return Object.assign(Object.assign({}, base), { value: AdvancedFiltersUtils.isDoubleInput(operator) ? [null, null] : null });
2782
- case FilterType.Date:
2783
- return Object.assign(Object.assign({}, base), { value: AdvancedFiltersUtils.isDoubleInput(operator) ? [new Date(), new Date()] : new Date() });
2784
- case FilterType.Radio:
2785
- return Object.assign(Object.assign({}, base), { value: AdvancedFiltersUtils.isDoubleInput(operator)
2786
- ? [(_a = config.options) === null || _a === void 0 ? void 0 : _a[0].key, (_b = config.options) === null || _b === void 0 ? void 0 : _b[0].key]
2787
- : (_c = config.options) === null || _c === void 0 ? void 0 : _c[0].key });
2788
- }
2789
- }
2790
- }
2791
- AdvancedFiltersUtils.noInputOperators = [
2792
- FilterOperatorTypes.IsEmpty,
2793
- FilterOperatorTypes.IsNotEmpty,
2794
- FilterOperatorTypes.IsNull,
2795
- FilterOperatorTypes.IsNotNull,
2796
- FilterOperatorTypes.None
2797
- ];
2798
- AdvancedFiltersUtils.singleInputOperators = [
2799
- FilterOperatorTypes.Equal,
2800
- FilterOperatorTypes.NotEqual,
2801
- FilterOperatorTypes.Less,
2802
- FilterOperatorTypes.LessOrEqual,
2803
- FilterOperatorTypes.Greater,
2804
- FilterOperatorTypes.GreaterOrEqual,
2805
- FilterOperatorTypes.BeginsWith,
2806
- FilterOperatorTypes.NotBeginsWith,
2807
- FilterOperatorTypes.EndsWith,
2808
- FilterOperatorTypes.NotEndsWith,
2809
- FilterOperatorTypes.Contains,
2810
- FilterOperatorTypes.NotContains
2811
- ];
2812
- AdvancedFiltersUtils.doubleInputOperators = [
2813
- FilterOperatorTypes.Between,
2814
- FilterOperatorTypes.NotBetween
2815
- ];
2816
-
2817
2751
  const ADVANCED_FILTER_ICONS = new InjectionToken("advanced_filter_icons");
2818
2752
 
2819
2753
  const EXPORTS_SETTINGS = new InjectionToken("exports_settings");
@@ -3284,6 +3218,7 @@ class NiceFilterViewService {
3284
3218
  this.store.update({
3285
3219
  filterResult: null
3286
3220
  });
3221
+ this.store.set([]);
3287
3222
  }
3288
3223
  else {
3289
3224
  this.store.update({
@@ -3294,6 +3229,12 @@ class NiceFilterViewService {
3294
3229
  }
3295
3230
  NiceFilterViewService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: NiceFilterViewService, deps: [{ token: NiceFilterViewStore }, { token: NiceFilterService }], target: i0.ɵɵFactoryTarget.Injectable });
3296
3231
  NiceFilterViewService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: NiceFilterViewService });
3232
+ __decorate([
3233
+ transaction(),
3234
+ __metadata("design:type", Function),
3235
+ __metadata("design:paramtypes", [Boolean]),
3236
+ __metadata("design:returntype", void 0)
3237
+ ], NiceFilterViewService.prototype, "resetResult", null);
3297
3238
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: NiceFilterViewService, decorators: [{
3298
3239
  type: Injectable
3299
3240
  }], ctorParameters: function () {
@@ -3301,7 +3242,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImpor
3301
3242
  type: Inject,
3302
3243
  args: [NiceFilterService]
3303
3244
  }] }];
3304
- } });
3245
+ }, propDecorators: { resetResult: [] } });
3305
3246
 
3306
3247
  class NiceFilterGroupIconPipe {
3307
3248
  constructor(service) {
@@ -3448,7 +3389,7 @@ class NiceAdvancedFiltersButtonComponent {
3448
3389
  this.query = query;
3449
3390
  this.service = service;
3450
3391
  this.shouldShowAdvancedFilters$ = this.query.selectSubState("showAdvancedFilters");
3451
- this.hasParameters$ = this.query.selectFilterParameters().pipe(withLatestFrom(this.query.selectFilterConfig()), map(([parameter, config]) => {
3392
+ this.hasParameters$ = this.query.selectFilterParameters().pipe(combineLatestWith(this.query.selectFilterConfig()), map(([parameter, config]) => {
3452
3393
  var _a, _b;
3453
3394
  return !!((_b = (_a = parameter
3454
3395
  .rules) === null || _a === void 0 ? void 0 : _a.filter((rule) => config.some((conf) => { var _a; return (conf === null || conf === void 0 ? void 0 : conf.id) === ((_a = rule.rules[0]) === null || _a === void 0 ? void 0 : _a.id); }))) === null || _b === void 0 ? void 0 : _b.length);
@@ -3458,16 +3399,15 @@ class NiceAdvancedFiltersButtonComponent {
3458
3399
  this.service.updateSubState("showAdvancedFilters", !this.query.getSubState("showAdvancedFilters"));
3459
3400
  }
3460
3401
  onSelectedFilter(filter) {
3461
- const rule = AdvancedFiltersUtils.createRule(filter);
3462
- this.service.setRules([{ condition: "and", rules: [rule] }]);
3463
3402
  this.service.updateSubState("showAdvancedFilters", true);
3403
+ this.service.updateSubState("selectedFilter", filter);
3464
3404
  }
3465
3405
  }
3466
3406
  NiceAdvancedFiltersButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: NiceAdvancedFiltersButtonComponent, deps: [{ token: ADVANCED_FILTER_ICONS, optional: true }, { token: NiceFilterViewQuery }, { token: NiceFilterViewService }], target: i0.ɵɵFactoryTarget.Component });
3467
- NiceAdvancedFiltersButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.3", type: NiceAdvancedFiltersButtonComponent, selector: "nice-advanced-filters-button", ngImport: i0, template: "<div class=\"relative\">\n <ng-container *ngIf=\"(hasParameters$ | async) && (shouldShowAdvancedFilters$ | async) !== true\">\n <div class=\"absolute top-2 right-2 w-1 h-1 rounded bg-accent\"></div>\n\n <button mat-icon-button (click)=\"clickToggleShowAdvancedFilters()\">\n <mat-icon [svgIcon]=\"icons.queryBuilder.svgIcon\">{{ icons.queryBuilder.matIcon }}</mat-icon>\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"shouldShowAdvancedFilters$ | async\">\n <button mat-icon-button (click)=\"clickToggleShowAdvancedFilters()\">\n <mat-icon [svgIcon]=\"icons.close.svgIcon\">{{ icons.close.matIcon }}</mat-icon>\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"(hasParameters$ | async) !== true && (shouldShowAdvancedFilters$ | async) !== true\">\n <button mat-icon-button niceAdvancedFiltersTrigger (advancedFilterSelected)=\"onSelectedFilter($event)\">\n <mat-icon [svgIcon]=\"icons.queryBuilder.svgIcon\">{{ icons.queryBuilder.matIcon }}</mat-icon>\n </button>\n </ng-container>\n</div>\n", styles: ["nice-advanced-filters-button{width:40px;height:40px}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i8.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: AdvancedFiltersTriggerDirective, selector: "[niceAdvancedFiltersTrigger]", inputs: ["position"], outputs: ["advancedFilterSelected"], exportAs: ["niceAdvancedFiltersTrigger"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
3407
+ NiceAdvancedFiltersButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.3", type: NiceAdvancedFiltersButtonComponent, selector: "nice-advanced-filters-button", ngImport: i0, template: "<div class=\"relative\">\n <ng-container *ngIf=\"(hasParameters$ | async) && (shouldShowAdvancedFilters$ | async) !== true\">\n <div class=\"absolute top-1 right-1 w-2 h-2 z-10 rounded bg-accent\"></div>\n\n <button mat-icon-button (click)=\"clickToggleShowAdvancedFilters()\">\n <mat-icon [svgIcon]=\"icons.queryBuilder.svgIcon\">{{ icons.queryBuilder.matIcon }}</mat-icon>\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"shouldShowAdvancedFilters$ | async\">\n <button mat-icon-button (click)=\"clickToggleShowAdvancedFilters()\">\n <mat-icon [svgIcon]=\"icons.close.svgIcon\">{{ icons.close.matIcon }}</mat-icon>\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"(hasParameters$ | async) !== true && (shouldShowAdvancedFilters$ | async) !== true\">\n <button mat-icon-button niceAdvancedFiltersTrigger (advancedFilterSelected)=\"onSelectedFilter($event)\">\n <mat-icon [svgIcon]=\"icons.queryBuilder.svgIcon\">{{ icons.queryBuilder.matIcon }}</mat-icon>\n </button>\n </ng-container>\n</div>\n", styles: ["nice-advanced-filters-button{width:40px;height:40px}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i8.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: AdvancedFiltersTriggerDirective, selector: "[niceAdvancedFiltersTrigger]", inputs: ["position"], outputs: ["advancedFilterSelected"], exportAs: ["niceAdvancedFiltersTrigger"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
3468
3408
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: NiceAdvancedFiltersButtonComponent, decorators: [{
3469
3409
  type: Component,
3470
- args: [{ selector: "nice-advanced-filters-button", encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"relative\">\n <ng-container *ngIf=\"(hasParameters$ | async) && (shouldShowAdvancedFilters$ | async) !== true\">\n <div class=\"absolute top-2 right-2 w-1 h-1 rounded bg-accent\"></div>\n\n <button mat-icon-button (click)=\"clickToggleShowAdvancedFilters()\">\n <mat-icon [svgIcon]=\"icons.queryBuilder.svgIcon\">{{ icons.queryBuilder.matIcon }}</mat-icon>\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"shouldShowAdvancedFilters$ | async\">\n <button mat-icon-button (click)=\"clickToggleShowAdvancedFilters()\">\n <mat-icon [svgIcon]=\"icons.close.svgIcon\">{{ icons.close.matIcon }}</mat-icon>\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"(hasParameters$ | async) !== true && (shouldShowAdvancedFilters$ | async) !== true\">\n <button mat-icon-button niceAdvancedFiltersTrigger (advancedFilterSelected)=\"onSelectedFilter($event)\">\n <mat-icon [svgIcon]=\"icons.queryBuilder.svgIcon\">{{ icons.queryBuilder.matIcon }}</mat-icon>\n </button>\n </ng-container>\n</div>\n", styles: ["nice-advanced-filters-button{width:40px;height:40px}\n"] }]
3410
+ args: [{ selector: "nice-advanced-filters-button", encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"relative\">\n <ng-container *ngIf=\"(hasParameters$ | async) && (shouldShowAdvancedFilters$ | async) !== true\">\n <div class=\"absolute top-1 right-1 w-2 h-2 z-10 rounded bg-accent\"></div>\n\n <button mat-icon-button (click)=\"clickToggleShowAdvancedFilters()\">\n <mat-icon [svgIcon]=\"icons.queryBuilder.svgIcon\">{{ icons.queryBuilder.matIcon }}</mat-icon>\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"shouldShowAdvancedFilters$ | async\">\n <button mat-icon-button (click)=\"clickToggleShowAdvancedFilters()\">\n <mat-icon [svgIcon]=\"icons.close.svgIcon\">{{ icons.close.matIcon }}</mat-icon>\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"(hasParameters$ | async) !== true && (shouldShowAdvancedFilters$ | async) !== true\">\n <button mat-icon-button niceAdvancedFiltersTrigger (advancedFilterSelected)=\"onSelectedFilter($event)\">\n <mat-icon [svgIcon]=\"icons.queryBuilder.svgIcon\">{{ icons.queryBuilder.matIcon }}</mat-icon>\n </button>\n </ng-container>\n</div>\n", styles: ["nice-advanced-filters-button{width:40px;height:40px}\n"] }]
3471
3411
  }], ctorParameters: function () {
3472
3412
  return [{ type: undefined, decorators: [{
3473
3413
  type: Optional
@@ -3622,6 +3562,72 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImpor
3622
3562
  type: Injectable
3623
3563
  }], ctorParameters: function () { return [{ type: NiceFilterService }]; } });
3624
3564
 
3565
+ class AdvancedFiltersUtils {
3566
+ static isSingleInput(filterOperator) {
3567
+ if (!filterOperator) {
3568
+ return false;
3569
+ }
3570
+ return AdvancedFiltersUtils.singleInputOperators.includes(filterOperator);
3571
+ }
3572
+ static isDoubleInput(filterOperator) {
3573
+ if (!filterOperator) {
3574
+ return false;
3575
+ }
3576
+ return AdvancedFiltersUtils.doubleInputOperators.includes(filterOperator);
3577
+ }
3578
+ static isNoInput(filterOperator) {
3579
+ if (!filterOperator) {
3580
+ return false;
3581
+ }
3582
+ return AdvancedFiltersUtils.noInputOperators.includes(filterOperator);
3583
+ }
3584
+ static createRule(config, operator) {
3585
+ var _a, _b, _c;
3586
+ const base = {
3587
+ id: config.id,
3588
+ operation: operator || config.operators[0].id
3589
+ };
3590
+ switch (config.type) {
3591
+ case FilterType.Text:
3592
+ return Object.assign(Object.assign({}, base), { value: AdvancedFiltersUtils.isDoubleInput(operator) ? ["", ""] : "" });
3593
+ case FilterType.Number:
3594
+ case FilterType.Select:
3595
+ return Object.assign(Object.assign({}, base), { value: AdvancedFiltersUtils.isDoubleInput(operator) ? [null, null] : null });
3596
+ case FilterType.Date:
3597
+ return Object.assign(Object.assign({}, base), { value: AdvancedFiltersUtils.isDoubleInput(operator) ? [new Date(), new Date()] : new Date() });
3598
+ case FilterType.Radio:
3599
+ return Object.assign(Object.assign({}, base), { value: AdvancedFiltersUtils.isDoubleInput(operator)
3600
+ ? [(_a = config.options) === null || _a === void 0 ? void 0 : _a[0].key, (_b = config.options) === null || _b === void 0 ? void 0 : _b[0].key]
3601
+ : (_c = config.options) === null || _c === void 0 ? void 0 : _c[0].key });
3602
+ }
3603
+ }
3604
+ }
3605
+ AdvancedFiltersUtils.noInputOperators = [
3606
+ FilterOperatorTypes.IsEmpty,
3607
+ FilterOperatorTypes.IsNotEmpty,
3608
+ FilterOperatorTypes.IsNull,
3609
+ FilterOperatorTypes.IsNotNull,
3610
+ FilterOperatorTypes.None
3611
+ ];
3612
+ AdvancedFiltersUtils.singleInputOperators = [
3613
+ FilterOperatorTypes.Equal,
3614
+ FilterOperatorTypes.NotEqual,
3615
+ FilterOperatorTypes.Less,
3616
+ FilterOperatorTypes.LessOrEqual,
3617
+ FilterOperatorTypes.Greater,
3618
+ FilterOperatorTypes.GreaterOrEqual,
3619
+ FilterOperatorTypes.BeginsWith,
3620
+ FilterOperatorTypes.NotBeginsWith,
3621
+ FilterOperatorTypes.EndsWith,
3622
+ FilterOperatorTypes.NotEndsWith,
3623
+ FilterOperatorTypes.Contains,
3624
+ FilterOperatorTypes.NotContains
3625
+ ];
3626
+ AdvancedFiltersUtils.doubleInputOperators = [
3627
+ FilterOperatorTypes.Between,
3628
+ FilterOperatorTypes.NotBetween
3629
+ ];
3630
+
3625
3631
  class FilterComponent {
3626
3632
  constructor() {
3627
3633
  this.propagateChanges = (_) => { };
@@ -3862,10 +3868,17 @@ class NiceAdvancedFiltersComponent {
3862
3868
  }
3863
3869
  ngOnInit() {
3864
3870
  var _a;
3865
- const { filterParameters } = this.query.getValue();
3871
+ const { filterParameters, subStates } = this.query.getValue();
3866
3872
  if ((_a = filterParameters.rules) === null || _a === void 0 ? void 0 : _a.length) {
3867
3873
  this.formGroup.patchValue(new AdvancedFiltersForm(filterParameters.rules[0]));
3868
3874
  }
3875
+ if (subStates.selectedFilter) {
3876
+ this.onClickAddRule(subStates.selectedFilter);
3877
+ return;
3878
+ }
3879
+ }
3880
+ ngOnDestroy() {
3881
+ this.removeEmptyRules({ reload: false });
3869
3882
  }
3870
3883
  onClickAddRule(filterConfigurationModel) {
3871
3884
  this.rulesFormArray.push(new FilterForm(AdvancedFiltersUtils.createRule(filterConfigurationModel)));
@@ -3880,6 +3893,7 @@ class NiceAdvancedFiltersComponent {
3880
3893
  }
3881
3894
  }
3882
3895
  onClose() {
3896
+ this.removeEmptyRules();
3883
3897
  this.service.updateSubState("showAdvancedFilters", false);
3884
3898
  }
3885
3899
  onRefresh() {
@@ -3887,6 +3901,31 @@ class NiceAdvancedFiltersComponent {
3887
3901
  this.service.resetResult(true);
3888
3902
  this.service.filter();
3889
3903
  }
3904
+ removeEmptyRules({ reload } = { reload: true }) {
3905
+ if (this.rulesFormArray.length !== 1) {
3906
+ return;
3907
+ }
3908
+ const values = this.rulesFormArray.get([0, "values"]).getRawValue();
3909
+ if (values.length !== 1) {
3910
+ return;
3911
+ }
3912
+ const value = values[0];
3913
+ if (value.value || value.value === false || value.secondValue || value.secondValue === true) {
3914
+ return;
3915
+ }
3916
+ this.rulesFormArray.removeAt(0);
3917
+ const { filterParameters } = this.query.getValue();
3918
+ if (!filterParameters.rules.length || !filterParameters.rules[0].rules.length) {
3919
+ return;
3920
+ }
3921
+ this.service.setRules([]);
3922
+ if (!reload) {
3923
+ return;
3924
+ }
3925
+ if (filterParameters.rules[0].rules[0].value) {
3926
+ this.service.filter();
3927
+ }
3928
+ }
3890
3929
  }
3891
3930
  NiceAdvancedFiltersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: NiceAdvancedFiltersComponent, deps: [{ token: ADVANCED_FILTER_ICONS, optional: true }, { token: i1$3.GeneratedFormGroup }, { token: NiceFilterViewQuery }, { token: NiceFilterViewService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3892
3931
  NiceAdvancedFiltersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.3", type: NiceAdvancedFiltersComponent, selector: "nice-advanced-filters", providers: [
@@ -4126,6 +4165,10 @@ class NiceSelectableListStateService {
4126
4165
  var _a, _b;
4127
4166
  return (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.preloadWindow) !== null && _b !== void 0 ? _b : 2;
4128
4167
  }
4168
+ get queryParamsDisabled() {
4169
+ var _a, _b;
4170
+ return (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.disableQueryParams) !== null && _b !== void 0 ? _b : false;
4171
+ }
4129
4172
  setActive(entity) {
4130
4173
  this.store.setActive(entity[this.idKey]);
4131
4174
  }
@@ -4339,10 +4382,12 @@ class NiceSelectableListStateService {
4339
4382
  };
4340
4383
  }
4341
4384
  setQueryParams() {
4342
- this.router.navigate([], {
4343
- queryParams: this.generateQueryParams(),
4344
- queryParamsHandling: "merge"
4345
- });
4385
+ if (!this.queryParamsDisabled) {
4386
+ this.router.navigate([], {
4387
+ queryParams: this.generateQueryParams(),
4388
+ queryParamsHandling: "merge"
4389
+ });
4390
+ }
4346
4391
  }
4347
4392
  }
4348
4393
 
@@ -4960,6 +5005,10 @@ class NiceSelectableListDirective {
4960
5005
  this.unsubscribeQuerySub$ = new Subject();
4961
5006
  }
4962
5007
  ngOnInit() {
5008
+ var _a;
5009
+ if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.disableQueryParams) {
5010
+ return;
5011
+ }
4963
5012
  combineLatest([
4964
5013
  this.route.queryParams.pipe(map((params) => params.selection), distinct()),
4965
5014
  this.route.queryParams.pipe(map((params) => params.selected), distinct())
@@ -4992,7 +5041,7 @@ class NiceSelectableListDirective {
4992
5041
  }
4993
5042
  if ("state" in changes) {
4994
5043
  this.service.setState(this.state);
4995
- this.stateService = this.selectableListService.withState(this.state);
5044
+ this.stateService = this.selectableListService.withState(this.state, this.options);
4996
5045
  this.stateQuery = this.selectableListService.query(this.state);
4997
5046
  this.listenOnStateChanges();
4998
5047
  }