@recursyve/nice-data-filter-kit 13.0.13 → 13.0.16
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/base-list/store/base-list.service.mjs +20 -4
- package/fesm2015/recursyve-nice-data-filter-kit.mjs +19 -8
- package/fesm2015/recursyve-nice-data-filter-kit.mjs.map +1 -1
- package/fesm2020/recursyve-nice-data-filter-kit.mjs +19 -3
- package/fesm2020/recursyve-nice-data-filter-kit.mjs.map +1 -1
- package/lib/components/base-list/store/base-list.service.d.ts +4 -2
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import * as i5 from '@recursyve/nice-ui-kit.v2';
|
|
|
3
3
|
import { isNullOrUndefined, ObjectUtils, FileUtils, ArrayUtils, ExportBottomSheetComponent, NiceLoadingSpinnerModule, NiceTypeaheadModule, NiceExportBottomSheetModule } from '@recursyve/nice-ui-kit.v2';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
5
|
import { Directive, Input, NgModule, Injectable, InjectionToken, Optional, Inject, Component, forwardRef, ViewEncapsulation, Pipe, EventEmitter, ChangeDetectionStrategy, Output, HostListener, TemplateRef, ContentChild, ContentChildren } from '@angular/core';
|
|
6
|
-
import { Store, StoreConfig, Query, arrayUpsert, arrayRemove } from '@datorama/akita';
|
|
6
|
+
import { Store, StoreConfig, Query, arrayAdd, arrayUpsert, arrayRemove } from '@datorama/akita';
|
|
7
7
|
import { combineLatest, Subject, firstValueFrom, of } from 'rxjs';
|
|
8
8
|
import { map, takeUntil, debounceTime, switchMap, distinctUntilChanged } from 'rxjs/operators';
|
|
9
9
|
import { __decorate, __metadata } from 'tslib';
|
|
@@ -978,7 +978,7 @@ class NiceBaseListService {
|
|
|
978
978
|
start: filterParameters.start + filterParameters.length
|
|
979
979
|
});
|
|
980
980
|
}
|
|
981
|
-
|
|
981
|
+
resetPaging() {
|
|
982
982
|
const { filterParameters } = this.store.getValue();
|
|
983
983
|
this.store.setParameters({
|
|
984
984
|
...filterParameters,
|
|
@@ -1058,7 +1058,10 @@ class NiceBaseListService {
|
|
|
1058
1058
|
defaultRules: rule
|
|
1059
1059
|
});
|
|
1060
1060
|
}
|
|
1061
|
-
async updateGlobalRules(rules, updateQueryParams = true) {
|
|
1061
|
+
async updateGlobalRules(rules, updateQueryParams = true, reset = true) {
|
|
1062
|
+
if (reset) {
|
|
1063
|
+
this.resetPaging();
|
|
1064
|
+
}
|
|
1062
1065
|
const { filterParameters } = this.store.getValue();
|
|
1063
1066
|
const newRules = {
|
|
1064
1067
|
...filterParameters,
|
|
@@ -1067,6 +1070,7 @@ class NiceBaseListService {
|
|
|
1067
1070
|
await this.loadData(newRules, updateQueryParams);
|
|
1068
1071
|
}
|
|
1069
1072
|
addRuleFromConfig(config) {
|
|
1073
|
+
this.resetPaging();
|
|
1070
1074
|
const { filterParameters } = this.store.getValue();
|
|
1071
1075
|
const newRules = {
|
|
1072
1076
|
...filterParameters,
|
|
@@ -1098,6 +1102,18 @@ class NiceBaseListService {
|
|
|
1098
1102
|
showQueryBuilder: !state.showQueryBuilder
|
|
1099
1103
|
}));
|
|
1100
1104
|
}
|
|
1105
|
+
addListValue(value, opts) {
|
|
1106
|
+
const { filterResult } = this.store.getValue();
|
|
1107
|
+
if (!filterResult) {
|
|
1108
|
+
return;
|
|
1109
|
+
}
|
|
1110
|
+
this.store.update({
|
|
1111
|
+
filterResult: {
|
|
1112
|
+
...filterResult,
|
|
1113
|
+
values: arrayAdd(value, opts)
|
|
1114
|
+
}
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1101
1117
|
updateListValue(value, key = "id") {
|
|
1102
1118
|
const { filterResult } = this.store.getValue();
|
|
1103
1119
|
if (!filterResult) {
|