@recursyve/nice-data-filter-kit 15.1.1 → 15.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/components/nice-filter-view/components/advanced-filters/advanced-filters.component.mjs +24 -1
- package/esm2020/lib/components/nice-filter-view/components/advanced-filters/button/advanced-filters-button.component.mjs +5 -5
- package/esm2020/lib/components/nice-filter-view/components/advanced-filters/filter-selection/filter-selection.component.mjs +1 -1
- package/esm2020/lib/components/nice-filter-view/components/advanced-filters/utils/advanced-filters.utils.mjs +1 -1
- package/esm2020/lib/components/nice-filter-view/components/export-buttons/export-buttons.component.mjs +6 -7
- package/esm2020/lib/components/nice-filter-view/directives/mat-paginator.mjs +13 -24
- package/esm2020/lib/components/nice-filter-view/directives/mat-sort.mjs +20 -30
- package/esm2020/lib/components/nice-filter-view/models/order-options.model.mjs +2 -0
- package/esm2020/lib/components/nice-filter-view/nice-base-filter-view.component.mjs +43 -2
- package/esm2020/lib/components/nice-filter-view/nice-filter-view.component.mjs +1 -1
- package/esm2020/lib/components/nice-filter-view/nice-nested-filter-view.mjs +46 -0
- package/esm2020/lib/components/nice-filter-view/public-api.mjs +2 -1
- package/esm2020/lib/components/nice-filter-view/store/nice-filter-view.service.mjs +29 -2
- package/esm2020/lib/components/nice-filter-view/store/nice-filter-view.store.mjs +10 -1
- package/esm2020/lib/models/filter.model.mjs +1 -1
- package/fesm2015/recursyve-nice-data-filter-kit.mjs +269 -131
- package/fesm2015/recursyve-nice-data-filter-kit.mjs.map +1 -1
- package/fesm2020/recursyve-nice-data-filter-kit.mjs +266 -140
- package/fesm2020/recursyve-nice-data-filter-kit.mjs.map +1 -1
- package/lib/components/nice-filter-view/components/advanced-filters/advanced-filters.component.d.ts +1 -0
- package/lib/components/nice-filter-view/components/export-buttons/export-buttons.component.d.ts +1 -2
- package/lib/components/nice-filter-view/directives/mat-paginator.d.ts +4 -9
- package/lib/components/nice-filter-view/directives/mat-sort.d.ts +4 -9
- package/lib/components/nice-filter-view/models/order-options.model.d.ts +7 -0
- package/lib/components/nice-filter-view/nice-base-filter-view.component.d.ts +19 -0
- package/lib/components/nice-filter-view/nice-nested-filter-view.d.ts +23 -0
- package/lib/components/nice-filter-view/public-api.d.ts +1 -0
- package/lib/components/nice-filter-view/store/nice-filter-view.service.d.ts +4 -0
- package/lib/components/nice-filter-view/store/nice-filter-view.store.d.ts +4 -1
- package/lib/models/filter.model.d.ts +11 -11
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { plainToInstance } from 'class-transformer';
|
|
2
|
-
import { map, takeUntil, debounceTime, switchMap, distinctUntilChanged,
|
|
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';
|
|
6
6
|
import * as i0 from '@angular/core';
|
|
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';
|
|
7
|
+
import { Directive, Input, NgModule, Injectable, Inject, InjectionToken, Optional, Pipe, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Output, HostListener, forwardRef, TemplateRef, ContentChild, ContentChildren, inject, QueryList, ViewChild } from '@angular/core';
|
|
8
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
|
-
import { __decorate, __metadata, __awaiter
|
|
10
|
+
import { __decorate, __metadata, __awaiter } from 'tslib';
|
|
11
11
|
import * as i2 from '@angular/router';
|
|
12
12
|
import { RouterModule } from '@angular/router';
|
|
13
13
|
import * as i4$1 from '@angular/material/bottom-sheet';
|
|
@@ -2839,6 +2839,7 @@ const initialValue = {
|
|
|
2839
2839
|
},
|
|
2840
2840
|
baseRules: [],
|
|
2841
2841
|
queryParams: null,
|
|
2842
|
+
orderColumns: null,
|
|
2842
2843
|
resetResult: false
|
|
2843
2844
|
};
|
|
2844
2845
|
class NiceFilterViewStore extends EntityStore {
|
|
@@ -2852,6 +2853,11 @@ class NiceFilterViewStore extends EntityStore {
|
|
|
2852
2853
|
setParameters(filterParameters) {
|
|
2853
2854
|
this.update({ filterParameters });
|
|
2854
2855
|
}
|
|
2856
|
+
patchParameters(filterParameters) {
|
|
2857
|
+
this.update(({ filterParameters: currentFilterParameters }) => ({
|
|
2858
|
+
filterParameters: Object.assign(Object.assign({}, currentFilterParameters), filterParameters)
|
|
2859
|
+
}));
|
|
2860
|
+
}
|
|
2855
2861
|
setResult(filterResult) {
|
|
2856
2862
|
const { mode, resetResult, initialLoadCompleted } = this.getValue();
|
|
2857
2863
|
if (mode === "accumulated") {
|
|
@@ -3181,6 +3187,9 @@ class NiceFilterViewService {
|
|
|
3181
3187
|
this.filter();
|
|
3182
3188
|
}
|
|
3183
3189
|
}
|
|
3190
|
+
patchParameters(filterParameters) {
|
|
3191
|
+
this.store.patchParameters(filterParameters);
|
|
3192
|
+
}
|
|
3184
3193
|
resetPaging() {
|
|
3185
3194
|
const { filterParameters } = this.store.getValue();
|
|
3186
3195
|
this.setParameters(Object.assign(Object.assign({}, filterParameters), { start: 0 }));
|
|
@@ -3197,6 +3206,30 @@ class NiceFilterViewService {
|
|
|
3197
3206
|
this.filter();
|
|
3198
3207
|
}
|
|
3199
3208
|
}
|
|
3209
|
+
addBaseRule(rule, reload) {
|
|
3210
|
+
this.store.update(({ baseRules }) => ({
|
|
3211
|
+
baseRules: arrayAdd(baseRules !== null && baseRules !== void 0 ? baseRules : [], rule)
|
|
3212
|
+
}));
|
|
3213
|
+
if (reload) {
|
|
3214
|
+
this.filter();
|
|
3215
|
+
}
|
|
3216
|
+
}
|
|
3217
|
+
upsertBaseRules(rule, reload) {
|
|
3218
|
+
this.store.update(({ baseRules }) => ({
|
|
3219
|
+
baseRules: arrayUpsert(baseRules !== null && baseRules !== void 0 ? baseRules : [], rule.id, rule)
|
|
3220
|
+
}));
|
|
3221
|
+
if (reload) {
|
|
3222
|
+
this.filter();
|
|
3223
|
+
}
|
|
3224
|
+
}
|
|
3225
|
+
removeBaseRules(key, reload) {
|
|
3226
|
+
this.store.update(({ baseRules }) => ({
|
|
3227
|
+
baseRules: arrayRemove(baseRules !== null && baseRules !== void 0 ? baseRules : [], key)
|
|
3228
|
+
}));
|
|
3229
|
+
if (reload) {
|
|
3230
|
+
this.filter();
|
|
3231
|
+
}
|
|
3232
|
+
}
|
|
3200
3233
|
setRules(rules) {
|
|
3201
3234
|
if (!Array.isArray(rules)) {
|
|
3202
3235
|
rules = [rules];
|
|
@@ -3453,7 +3486,7 @@ class NiceAdvancedFiltersButtonComponent {
|
|
|
3453
3486
|
this.query = query;
|
|
3454
3487
|
this.service = service;
|
|
3455
3488
|
this.shouldShowAdvancedFilters$ = this.query.selectSubState("showAdvancedFilters");
|
|
3456
|
-
this.hasParameters$ = this.query.selectFilterParameters().pipe(
|
|
3489
|
+
this.hasParameters$ = this.query.selectFilterParameters().pipe(combineLatestWith(this.query.selectFilterConfig()), map(([parameter, config]) => {
|
|
3457
3490
|
var _a, _b;
|
|
3458
3491
|
return !!((_b = (_a = parameter
|
|
3459
3492
|
.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);
|
|
@@ -3469,10 +3502,10 @@ class NiceAdvancedFiltersButtonComponent {
|
|
|
3469
3502
|
}
|
|
3470
3503
|
}
|
|
3471
3504
|
NiceAdvancedFiltersButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceAdvancedFiltersButtonComponent, deps: [{ token: ADVANCED_FILTER_ICONS, optional: true }, { token: NiceFilterViewQuery }, { token: NiceFilterViewService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3472
|
-
NiceAdvancedFiltersButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", 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-
|
|
3505
|
+
NiceAdvancedFiltersButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", 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.MatIconButton, selector: "button[mat-icon-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 });
|
|
3473
3506
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceAdvancedFiltersButtonComponent, decorators: [{
|
|
3474
3507
|
type: Component,
|
|
3475
|
-
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-
|
|
3508
|
+
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"] }]
|
|
3476
3509
|
}], ctorParameters: function () {
|
|
3477
3510
|
return [{ type: undefined, decorators: [{
|
|
3478
3511
|
type: Optional
|
|
@@ -3885,6 +3918,7 @@ class NiceAdvancedFiltersComponent {
|
|
|
3885
3918
|
}
|
|
3886
3919
|
}
|
|
3887
3920
|
onClose() {
|
|
3921
|
+
this.removeEmptyRules();
|
|
3888
3922
|
this.service.updateSubState("showAdvancedFilters", false);
|
|
3889
3923
|
}
|
|
3890
3924
|
onRefresh() {
|
|
@@ -3892,6 +3926,28 @@ class NiceAdvancedFiltersComponent {
|
|
|
3892
3926
|
this.service.resetResult(true);
|
|
3893
3927
|
this.service.filter();
|
|
3894
3928
|
}
|
|
3929
|
+
removeEmptyRules() {
|
|
3930
|
+
if (this.rulesFormArray.length !== 1) {
|
|
3931
|
+
return;
|
|
3932
|
+
}
|
|
3933
|
+
const values = this.rulesFormArray.get([0, "values"]).getRawValue();
|
|
3934
|
+
if (values.length !== 1) {
|
|
3935
|
+
return;
|
|
3936
|
+
}
|
|
3937
|
+
const value = values[0];
|
|
3938
|
+
if (value.value || value.value === false || value.secondValue || value.secondValue === true) {
|
|
3939
|
+
return;
|
|
3940
|
+
}
|
|
3941
|
+
this.rulesFormArray.removeAt(0);
|
|
3942
|
+
const { filterParameters } = this.query.getValue();
|
|
3943
|
+
if (!filterParameters.rules.length || !filterParameters.rules[0].rules.length) {
|
|
3944
|
+
return;
|
|
3945
|
+
}
|
|
3946
|
+
this.service.setRules([]);
|
|
3947
|
+
if (filterParameters.rules[0].rules[0].value) {
|
|
3948
|
+
this.service.filter();
|
|
3949
|
+
}
|
|
3950
|
+
}
|
|
3895
3951
|
}
|
|
3896
3952
|
NiceAdvancedFiltersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", 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 });
|
|
3897
3953
|
NiceAdvancedFiltersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: NiceAdvancedFiltersComponent, selector: "nice-advanced-filters", providers: [
|
|
@@ -4406,11 +4462,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
4406
4462
|
} });
|
|
4407
4463
|
|
|
4408
4464
|
class NiceFilterExportButtonsComponent {
|
|
4409
|
-
constructor(icons, exportsSettings, niceFilterViewQuery,
|
|
4465
|
+
constructor(icons, exportsSettings, niceFilterViewQuery, selectableListService, query, service, bottomSheet) {
|
|
4410
4466
|
this.icons = icons;
|
|
4411
4467
|
this.exportsSettings = exportsSettings;
|
|
4412
4468
|
this.niceFilterViewQuery = niceFilterViewQuery;
|
|
4413
|
-
this.niceFilterViewService = niceFilterViewService;
|
|
4414
4469
|
this.selectableListService = selectableListService;
|
|
4415
4470
|
this.query = query;
|
|
4416
4471
|
this.service = service;
|
|
@@ -4485,7 +4540,7 @@ class NiceFilterExportButtonsComponent {
|
|
|
4485
4540
|
this.service.downloadData("pdf", this.downloadFileName, ids);
|
|
4486
4541
|
}
|
|
4487
4542
|
}
|
|
4488
|
-
NiceFilterExportButtonsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterExportButtonsComponent, deps: [{ token: FILTER_VIEW_ICONS }, { token: EXPORTS_SETTINGS }, { token: NiceFilterViewQuery }, { token:
|
|
4543
|
+
NiceFilterExportButtonsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterExportButtonsComponent, deps: [{ token: FILTER_VIEW_ICONS }, { token: EXPORTS_SETTINGS }, { token: NiceFilterViewQuery }, { token: NiceSelectableListService }, { token: NiceFilterViewQuery }, { token: NiceFilterViewService }, { token: i4$1.MatBottomSheet }], target: i0.ɵɵFactoryTarget.Component });
|
|
4489
4544
|
NiceFilterExportButtonsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: NiceFilterExportButtonsComponent, selector: "nice-filter-export-buttons, div[nice-filter-export-buttons]", inputs: { customExport: "customExport", downloadFileName: "downloadFileName", canPrint: "canPrint" }, ngImport: i0, template: "<button\n *ngIf=\"canPrint\"\n (click)=\"clickPrint()\"\n [disabled]=\"loading$ | async\"\n [matTooltip]=\"'general.print' | translate\"\n class=\"export-button\"\n mat-mini-fab\n>\n <mat-icon [svgIcon]=\"icons.print.svgIcon\">{{ icons.print.matIcon }}</mat-icon>\n</button>\n\n<button\n (click)=\"clickExport()\"\n [disabled]=\"loading$ | async\"\n [matTooltip]=\"'general.export' | translate\"\n class=\"export-button\"\n mat-mini-fab\n>\n <mat-icon [svgIcon]=\"icons.download.svgIcon\">{{ icons.download.matIcon }}</mat-icon>\n</button>\n", styles: [""], dependencies: [{ kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i10.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i8.MatMiniFabButton, selector: "button[mat-mini-fab]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }], encapsulation: i0.ViewEncapsulation.None });
|
|
4490
4545
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterExportButtonsComponent, decorators: [{
|
|
4491
4546
|
type: Component,
|
|
@@ -4497,7 +4552,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
4497
4552
|
}] }, { type: undefined, decorators: [{
|
|
4498
4553
|
type: Inject,
|
|
4499
4554
|
args: [EXPORTS_SETTINGS]
|
|
4500
|
-
}] }, { type: NiceFilterViewQuery }, { type:
|
|
4555
|
+
}] }, { type: NiceFilterViewQuery }, { type: NiceSelectableListService }, { type: NiceFilterViewQuery }, { type: NiceFilterViewService }, { type: i4$1.MatBottomSheet }];
|
|
4501
4556
|
}, propDecorators: { customExport: [{
|
|
4502
4557
|
type: Input
|
|
4503
4558
|
}], downloadFileName: [{
|
|
@@ -4602,103 +4657,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
4602
4657
|
type: Input
|
|
4603
4658
|
}] } });
|
|
4604
4659
|
|
|
4605
|
-
class NiceFilterMatPaginatorPaginationDirective {
|
|
4606
|
-
constructor(query, service, paginator) {
|
|
4607
|
-
this.query = query;
|
|
4608
|
-
this.service = service;
|
|
4609
|
-
this.paginator = paginator;
|
|
4610
|
-
this.unsubscribeAll$ = new Subject();
|
|
4611
|
-
}
|
|
4612
|
-
ngOnInit() {
|
|
4613
|
-
this.query.selectFilterResult().pipe(takeUntil(this.unsubscribeAll$)).subscribe((res) => {
|
|
4614
|
-
if (!res) {
|
|
4615
|
-
return;
|
|
4616
|
-
}
|
|
4617
|
-
const { page, total } = res;
|
|
4618
|
-
this.paginator.pageIndex = page.number;
|
|
4619
|
-
this.paginator.pageSize = page.size;
|
|
4620
|
-
this.paginator.length = total;
|
|
4621
|
-
});
|
|
4622
|
-
this.paginator.page.pipe(takeUntil(this.unsubscribeAll$)).subscribe((page) => {
|
|
4623
|
-
const { filterParameters } = this.query.getValue();
|
|
4624
|
-
this.service.setParameters(Object.assign(Object.assign({}, filterParameters), { start: page.pageIndex * page.pageSize, length: page.pageSize }));
|
|
4625
|
-
this.service.filter();
|
|
4626
|
-
});
|
|
4627
|
-
}
|
|
4628
|
-
ngOnDestroy() {
|
|
4629
|
-
this.unsubscribeAll$.next();
|
|
4630
|
-
this.unsubscribeAll$.complete();
|
|
4631
|
-
}
|
|
4632
|
-
}
|
|
4633
|
-
NiceFilterMatPaginatorPaginationDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterMatPaginatorPaginationDirective, deps: [{ token: NiceFilterViewQuery }, { token: NiceFilterViewService }, { token: i12.MatPaginator }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4634
|
-
NiceFilterMatPaginatorPaginationDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: NiceFilterMatPaginatorPaginationDirective, selector: "mat-paginator[niceFilterPagination]", ngImport: i0 });
|
|
4635
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterMatPaginatorPaginationDirective, decorators: [{
|
|
4636
|
-
type: Directive,
|
|
4637
|
-
args: [{ selector: "mat-paginator[niceFilterPagination]" }]
|
|
4638
|
-
}], ctorParameters: function () { return [{ type: NiceFilterViewQuery }, { type: NiceFilterViewService }, { type: i12.MatPaginator }]; } });
|
|
4639
|
-
|
|
4640
|
-
class NiceFilterMatSortSortingDirective {
|
|
4641
|
-
constructor(query, service, sort) {
|
|
4642
|
-
this.query = query;
|
|
4643
|
-
this.service = service;
|
|
4644
|
-
this.sort = sort;
|
|
4645
|
-
this.unsubscribeAll$ = new Subject();
|
|
4646
|
-
}
|
|
4647
|
-
ngOnInit() {
|
|
4648
|
-
this.query.selectFilterParameters().pipe(takeUntil(this.unsubscribeAll$)).subscribe((res) => {
|
|
4649
|
-
if (!res) {
|
|
4650
|
-
return;
|
|
4651
|
-
}
|
|
4652
|
-
const { order } = res;
|
|
4653
|
-
if (!order) {
|
|
4654
|
-
return;
|
|
4655
|
-
}
|
|
4656
|
-
this.sort.direction = order.direction;
|
|
4657
|
-
this.sort.active = order.column;
|
|
4658
|
-
});
|
|
4659
|
-
this.sort.sortChange.pipe(takeUntil(this.unsubscribeAll$)).subscribe((sort) => {
|
|
4660
|
-
const { filterParameters } = this.query.getValue();
|
|
4661
|
-
if (!sort.direction) {
|
|
4662
|
-
const { order } = filterParameters, values = __rest(filterParameters, ["order"]);
|
|
4663
|
-
this.service.setParameters(Object.assign(Object.assign({}, values), { order: {} }));
|
|
4664
|
-
}
|
|
4665
|
-
else {
|
|
4666
|
-
this.service.setParameters(Object.assign(Object.assign({}, filterParameters), { order: {
|
|
4667
|
-
column: sort.active,
|
|
4668
|
-
direction: sort.direction
|
|
4669
|
-
} }));
|
|
4670
|
-
}
|
|
4671
|
-
this.service.filter();
|
|
4672
|
-
});
|
|
4673
|
-
}
|
|
4674
|
-
ngOnDestroy() {
|
|
4675
|
-
this.unsubscribeAll$.next();
|
|
4676
|
-
this.unsubscribeAll$.complete();
|
|
4677
|
-
}
|
|
4678
|
-
}
|
|
4679
|
-
NiceFilterMatSortSortingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterMatSortSortingDirective, deps: [{ token: NiceFilterViewQuery }, { token: NiceFilterViewService }, { token: i14.MatSort }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4680
|
-
NiceFilterMatSortSortingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: NiceFilterMatSortSortingDirective, selector: "mat-table[matSort][niceFilterSorting]", ngImport: i0 });
|
|
4681
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterMatSortSortingDirective, decorators: [{
|
|
4682
|
-
type: Directive,
|
|
4683
|
-
args: [{ selector: "mat-table[matSort][niceFilterSorting]" }]
|
|
4684
|
-
}], ctorParameters: function () { return [{ type: NiceFilterViewQuery }, { type: NiceFilterViewService }, { type: i14.MatSort }]; } });
|
|
4685
|
-
|
|
4686
|
-
class NiceFilterMatTableViewDirective {
|
|
4687
|
-
constructor(query, table) {
|
|
4688
|
-
this.query = query;
|
|
4689
|
-
this.table = table;
|
|
4690
|
-
}
|
|
4691
|
-
ngOnInit() {
|
|
4692
|
-
this.table.dataSource = this.query.selectAll();
|
|
4693
|
-
}
|
|
4694
|
-
}
|
|
4695
|
-
NiceFilterMatTableViewDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterMatTableViewDirective, deps: [{ token: NiceFilterViewQuery }, { token: i13.MatTable }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4696
|
-
NiceFilterMatTableViewDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: NiceFilterMatTableViewDirective, selector: "mat-table[niceFilterDataView]", ngImport: i0 });
|
|
4697
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterMatTableViewDirective, decorators: [{
|
|
4698
|
-
type: Directive,
|
|
4699
|
-
args: [{ selector: "mat-table[niceFilterDataView]" }]
|
|
4700
|
-
}], ctorParameters: function () { return [{ type: NiceFilterViewQuery }, { type: i13.MatTable }]; } });
|
|
4701
|
-
|
|
4702
4660
|
class NiceFilterQueryParamsDirective {
|
|
4703
4661
|
get initialized() {
|
|
4704
4662
|
return this._initialized;
|
|
@@ -4775,33 +4733,142 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
4775
4733
|
type: Output
|
|
4776
4734
|
}] } });
|
|
4777
4735
|
|
|
4778
|
-
class
|
|
4779
|
-
constructor(
|
|
4780
|
-
this.
|
|
4781
|
-
this.
|
|
4736
|
+
class NiceNestedFilterView {
|
|
4737
|
+
constructor() {
|
|
4738
|
+
this._afterQueryParamHooks = new Set();
|
|
4739
|
+
this.unsubscribeAll$ = new Subject();
|
|
4740
|
+
this.filterViewService = inject(NiceFilterViewService);
|
|
4741
|
+
this.filterViewQuery = inject(NiceFilterViewQuery);
|
|
4742
|
+
this.queryParams = inject(NiceFilterQueryParamsDirective, { optional: true });
|
|
4782
4743
|
}
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4744
|
+
ngOnInit() {
|
|
4745
|
+
var _a;
|
|
4746
|
+
this.filterViewLoading$ = this.filterViewQuery.selectLoading();
|
|
4747
|
+
this.filterViewCount$ = this.filterViewQuery.selectCount();
|
|
4748
|
+
if (!this.queryParams || ((_a = this.queryParams) === null || _a === void 0 ? void 0 : _a.initialized)) {
|
|
4749
|
+
this.onInit();
|
|
4750
|
+
return;
|
|
4751
|
+
}
|
|
4752
|
+
this.queryParams.init.pipe(take(1)).subscribe(() => this.onInit());
|
|
4753
|
+
}
|
|
4754
|
+
ngOnDestroy() {
|
|
4755
|
+
this.unsubscribeAll$.next();
|
|
4756
|
+
this.unsubscribeAll$.complete();
|
|
4757
|
+
}
|
|
4758
|
+
afterInit(fn) {
|
|
4759
|
+
var _a;
|
|
4760
|
+
if (!this.queryParams || ((_a = this.queryParams) === null || _a === void 0 ? void 0 : _a.initialized)) {
|
|
4761
|
+
fn.bind(this)();
|
|
4762
|
+
return;
|
|
4763
|
+
}
|
|
4764
|
+
this._afterQueryParamHooks.add(fn);
|
|
4765
|
+
}
|
|
4766
|
+
onInit() {
|
|
4767
|
+
for (const hook of this._afterQueryParamHooks) {
|
|
4768
|
+
hook.bind(this)();
|
|
4786
4769
|
}
|
|
4787
4770
|
}
|
|
4788
4771
|
}
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4772
|
+
NiceNestedFilterView.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceNestedFilterView, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4773
|
+
NiceNestedFilterView.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: NiceNestedFilterView, ngImport: i0 });
|
|
4774
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceNestedFilterView, decorators: [{
|
|
4775
|
+
type: Directive
|
|
4776
|
+
}] });
|
|
4777
|
+
|
|
4778
|
+
class NiceFilterMatPaginatorPaginationDirective extends NiceNestedFilterView {
|
|
4779
|
+
constructor(paginator) {
|
|
4780
|
+
super();
|
|
4781
|
+
this.paginator = paginator;
|
|
4782
|
+
}
|
|
4783
|
+
ngOnInit() {
|
|
4784
|
+
super.ngOnInit();
|
|
4785
|
+
this.filterViewQuery.selectFilterResult().pipe(takeUntil(this.unsubscribeAll$)).subscribe((res) => {
|
|
4786
|
+
if (!res) {
|
|
4787
|
+
return;
|
|
4788
|
+
}
|
|
4789
|
+
const { page, total } = res;
|
|
4790
|
+
this.paginator.pageIndex = page.number;
|
|
4791
|
+
this.paginator.pageSize = page.size;
|
|
4792
|
+
this.paginator.length = total;
|
|
4793
|
+
});
|
|
4794
|
+
this.paginator.page.pipe(takeUntil(this.unsubscribeAll$)).subscribe((page) => {
|
|
4795
|
+
this.filterViewService.patchParameters({
|
|
4796
|
+
start: page.pageIndex * page.pageSize,
|
|
4797
|
+
length: page.pageSize
|
|
4798
|
+
});
|
|
4799
|
+
this.filterViewService.filter();
|
|
4800
|
+
});
|
|
4801
|
+
}
|
|
4802
|
+
}
|
|
4803
|
+
NiceFilterMatPaginatorPaginationDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterMatPaginatorPaginationDirective, deps: [{ token: i12.MatPaginator }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4804
|
+
NiceFilterMatPaginatorPaginationDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: NiceFilterMatPaginatorPaginationDirective, selector: "mat-paginator[niceFilterPagination]", usesInheritance: true, ngImport: i0 });
|
|
4805
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterMatPaginatorPaginationDirective, decorators: [{
|
|
4806
|
+
type: Directive,
|
|
4807
|
+
args: [{ selector: "mat-paginator[niceFilterPagination]" }]
|
|
4808
|
+
}], ctorParameters: function () { return [{ type: i12.MatPaginator }]; } });
|
|
4809
|
+
|
|
4810
|
+
class NiceFilterMatSortSortingDirective extends NiceNestedFilterView {
|
|
4811
|
+
constructor(sort) {
|
|
4812
|
+
super();
|
|
4813
|
+
this.sort = sort;
|
|
4814
|
+
}
|
|
4815
|
+
ngOnInit() {
|
|
4816
|
+
super.ngOnInit();
|
|
4817
|
+
this.filterViewQuery.selectFilterParameters().pipe(takeUntil(this.unsubscribeAll$)).subscribe((res) => {
|
|
4818
|
+
if (!res) {
|
|
4819
|
+
return;
|
|
4820
|
+
}
|
|
4821
|
+
const { order } = res;
|
|
4822
|
+
if (!order) {
|
|
4823
|
+
return;
|
|
4824
|
+
}
|
|
4825
|
+
this.sort.direction = order.direction;
|
|
4826
|
+
this.sort.active = order.column;
|
|
4827
|
+
});
|
|
4828
|
+
this.sort.sortChange.pipe(takeUntil(this.unsubscribeAll$)).subscribe((sort) => {
|
|
4829
|
+
var _a;
|
|
4830
|
+
const { orderColumns } = this.filterViewQuery.getValue();
|
|
4831
|
+
const column = orderColumns === null || orderColumns === void 0 ? void 0 : orderColumns[sort.active];
|
|
4832
|
+
if (!sort.direction) {
|
|
4833
|
+
this.filterViewService.patchParameters({
|
|
4834
|
+
order: null
|
|
4835
|
+
});
|
|
4836
|
+
}
|
|
4837
|
+
else {
|
|
4838
|
+
this.filterViewService.patchParameters({
|
|
4839
|
+
order: {
|
|
4840
|
+
column: (_a = column === null || column === void 0 ? void 0 : column.column) !== null && _a !== void 0 ? _a : sort.active,
|
|
4841
|
+
direction: sort.direction,
|
|
4842
|
+
nullLast: column === null || column === void 0 ? void 0 : column.nullLast
|
|
4843
|
+
}
|
|
4844
|
+
});
|
|
4845
|
+
}
|
|
4846
|
+
this.filterViewService.filter();
|
|
4847
|
+
});
|
|
4848
|
+
}
|
|
4849
|
+
}
|
|
4850
|
+
NiceFilterMatSortSortingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterMatSortSortingDirective, deps: [{ token: i14.MatSort }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4851
|
+
NiceFilterMatSortSortingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: NiceFilterMatSortSortingDirective, selector: "mat-table[matSort][niceFilterSorting]", usesInheritance: true, ngImport: i0 });
|
|
4852
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterMatSortSortingDirective, decorators: [{
|
|
4853
|
+
type: Directive,
|
|
4854
|
+
args: [{ selector: "mat-table[matSort][niceFilterSorting]" }]
|
|
4855
|
+
}], ctorParameters: function () { return [{ type: i14.MatSort }]; } });
|
|
4856
|
+
|
|
4857
|
+
class NiceFilterMatTableViewDirective {
|
|
4858
|
+
constructor(query, table) {
|
|
4859
|
+
this.query = query;
|
|
4860
|
+
this.table = table;
|
|
4861
|
+
}
|
|
4862
|
+
ngOnInit() {
|
|
4863
|
+
this.table.dataSource = this.query.selectAll();
|
|
4864
|
+
}
|
|
4865
|
+
}
|
|
4866
|
+
NiceFilterMatTableViewDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterMatTableViewDirective, deps: [{ token: NiceFilterViewQuery }, { token: i13.MatTable }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4867
|
+
NiceFilterMatTableViewDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: NiceFilterMatTableViewDirective, selector: "mat-table[niceFilterDataView]", ngImport: i0 });
|
|
4868
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterMatTableViewDirective, decorators: [{
|
|
4869
|
+
type: Directive,
|
|
4870
|
+
args: [{ selector: "mat-table[niceFilterDataView]" }]
|
|
4871
|
+
}], ctorParameters: function () { return [{ type: NiceFilterViewQuery }, { type: i13.MatTable }]; } });
|
|
4805
4872
|
|
|
4806
4873
|
class NiceSelectableListContentService {
|
|
4807
4874
|
constructor() {
|
|
@@ -5044,8 +5111,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
5044
5111
|
args: [NiceSelectableListCheckboxDirective, { descendants: true }]
|
|
5045
5112
|
}] } });
|
|
5046
5113
|
|
|
5114
|
+
class NiceFilterViewComponent {
|
|
5115
|
+
constructor(service) {
|
|
5116
|
+
this.service = service;
|
|
5117
|
+
this.queryParams = {};
|
|
5118
|
+
}
|
|
5119
|
+
ngOnChanges(changes) {
|
|
5120
|
+
if ("queryParams" in changes) {
|
|
5121
|
+
this.service.setQueryParams(this.queryParams);
|
|
5122
|
+
}
|
|
5123
|
+
}
|
|
5124
|
+
}
|
|
5125
|
+
NiceFilterViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterViewComponent, deps: [{ token: NiceFilterViewService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5126
|
+
NiceFilterViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: NiceFilterViewComponent, selector: "nice-filter-view", inputs: { queryParams: "queryParams" }, providers: [
|
|
5127
|
+
NiceFilterViewQuery,
|
|
5128
|
+
NiceFilterViewService,
|
|
5129
|
+
NiceFilterViewStore
|
|
5130
|
+
], usesOnChanges: true, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [""], encapsulation: i0.ViewEncapsulation.None });
|
|
5131
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceFilterViewComponent, decorators: [{
|
|
5132
|
+
type: Component,
|
|
5133
|
+
args: [{ selector: "nice-filter-view", encapsulation: ViewEncapsulation.None, providers: [
|
|
5134
|
+
NiceFilterViewQuery,
|
|
5135
|
+
NiceFilterViewService,
|
|
5136
|
+
NiceFilterViewStore
|
|
5137
|
+
], template: "<ng-content></ng-content>\n" }]
|
|
5138
|
+
}], ctorParameters: function () { return [{ type: NiceFilterViewService }]; }, propDecorators: { queryParams: [{
|
|
5139
|
+
type: Input
|
|
5140
|
+
}] } });
|
|
5141
|
+
|
|
5047
5142
|
class NiceBaseFilterViewComponent {
|
|
5143
|
+
constructor() {
|
|
5144
|
+
this._afterQueryParamHooks = new Set();
|
|
5145
|
+
}
|
|
5048
5146
|
ngOnInit(autoLoad = true, { mode, loadConfig, configQueryParams } = {}) {
|
|
5147
|
+
var _a;
|
|
5049
5148
|
if (mode) {
|
|
5050
5149
|
this.filterViewService.setMode(mode);
|
|
5051
5150
|
}
|
|
@@ -5056,6 +5155,11 @@ class NiceBaseFilterViewComponent {
|
|
|
5056
5155
|
if (this.selectableListDirective) {
|
|
5057
5156
|
this.filterViewService.updateSubState("selectable", { stateName: this.selectableListDirective.state });
|
|
5058
5157
|
}
|
|
5158
|
+
if (!this.queryParams || ((_a = this.queryParams) === null || _a === void 0 ? void 0 : _a.initialized)) {
|
|
5159
|
+
this.onInit();
|
|
5160
|
+
return;
|
|
5161
|
+
}
|
|
5162
|
+
this.queryParams.init.pipe(take(1)).subscribe(() => this.onInit());
|
|
5059
5163
|
}
|
|
5060
5164
|
/**
|
|
5061
5165
|
* Call the filter endpoint with the current filter parameters.
|
|
@@ -5088,6 +5192,27 @@ class NiceBaseFilterViewComponent {
|
|
|
5088
5192
|
setBaseRules(rule, reload = true) {
|
|
5089
5193
|
this.filterViewService.setBaseRules(rule, reload);
|
|
5090
5194
|
}
|
|
5195
|
+
/**
|
|
5196
|
+
* Add a rule to the set of rules that won't be saved in the current filterParameters config.
|
|
5197
|
+
* NOTE: These rules will be injected in each filter request.
|
|
5198
|
+
*/
|
|
5199
|
+
addBaseRule(rule, reload = true) {
|
|
5200
|
+
this.filterViewService.addBaseRule(rule, reload);
|
|
5201
|
+
}
|
|
5202
|
+
/**
|
|
5203
|
+
* Add a rule to the set of rules that won't be saved in the current filterParameters config.
|
|
5204
|
+
* NOTE: These rules will be injected in each filter request.
|
|
5205
|
+
*/
|
|
5206
|
+
upsertBaseRule(rule, reload = true) {
|
|
5207
|
+
this.filterViewService.upsertBaseRules(rule, reload);
|
|
5208
|
+
}
|
|
5209
|
+
/**
|
|
5210
|
+
* Remove a rule to the set of rules that won't be saved in the current filterParameters config.
|
|
5211
|
+
* NOTE: These rules will be injected in each filter request.
|
|
5212
|
+
*/
|
|
5213
|
+
removeBaseRule(id, reload = true) {
|
|
5214
|
+
this.filterViewService.removeBaseRules(id, reload);
|
|
5215
|
+
}
|
|
5091
5216
|
/**
|
|
5092
5217
|
* Reset all rules with a new set of rules.
|
|
5093
5218
|
*/
|
|
@@ -5117,6 +5242,14 @@ class NiceBaseFilterViewComponent {
|
|
|
5117
5242
|
this.filterViewService.filter();
|
|
5118
5243
|
}
|
|
5119
5244
|
}
|
|
5245
|
+
afterInit(fn) {
|
|
5246
|
+
var _a;
|
|
5247
|
+
if (!this.queryParams || ((_a = this.queryParams) === null || _a === void 0 ? void 0 : _a.initialized)) {
|
|
5248
|
+
fn.bind(this)();
|
|
5249
|
+
return;
|
|
5250
|
+
}
|
|
5251
|
+
this._afterQueryParamHooks.add(fn);
|
|
5252
|
+
}
|
|
5120
5253
|
autoLoad(autoLoad) {
|
|
5121
5254
|
const { autoLoad: defaultAutoLoad } = this.filterViewQuery.getValue();
|
|
5122
5255
|
if (!this.queryParams) {
|
|
@@ -5146,6 +5279,11 @@ class NiceBaseFilterViewComponent {
|
|
|
5146
5279
|
this.filterViewService.loadConfig(configQueryParams);
|
|
5147
5280
|
}
|
|
5148
5281
|
}
|
|
5282
|
+
onInit() {
|
|
5283
|
+
for (const hook of this._afterQueryParamHooks) {
|
|
5284
|
+
hook.bind(this)();
|
|
5285
|
+
}
|
|
5286
|
+
}
|
|
5149
5287
|
}
|
|
5150
5288
|
NiceBaseFilterViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NiceBaseFilterViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5151
5289
|
NiceBaseFilterViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: NiceBaseFilterViewComponent, selector: "ng-component", viewQueries: [{ propertyName: "filterViewService", first: true, predicate: NiceFilterViewComponent, descendants: true, read: NiceFilterViewService, static: true }, { propertyName: "filterViewQuery", first: true, predicate: NiceFilterViewComponent, descendants: true, read: NiceFilterViewQuery, static: true }, { propertyName: "queryParams", first: true, predicate: NiceFilterQueryParamsDirective, descendants: true, static: true }, { propertyName: "advancedFiltersButton", first: true, predicate: NiceAdvancedFiltersButtonComponent, descendants: true, static: true }, { propertyName: "advancedFilters", first: true, predicate: NiceAdvancedFiltersComponent, descendants: true, static: true }, { propertyName: "selectableListDirective", first: true, predicate: NiceSelectableListDirective, descendants: true, static: true }], ngImport: i0, template: ``, isInline: true });
|
|
@@ -5428,5 +5566,5 @@ String.prototype.toTableColumn = function (sortableOrOptions, nullLast) {
|
|
|
5428
5566
|
* Generated bundle index. Do not edit.
|
|
5429
5567
|
*/
|
|
5430
5568
|
|
|
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 };
|
|
5569
|
+
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, NiceNestedFilterView, 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 };
|
|
5432
5570
|
//# sourceMappingURL=recursyve-nice-data-filter-kit.mjs.map
|