@recursyve/nice-data-filter-kit 13.0.14 → 13.0.17
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 -8
- package/fesm2015/recursyve-nice-data-filter-kit.mjs +15 -6
- package/fesm2015/recursyve-nice-data-filter-kit.mjs.map +1 -1
- package/fesm2020/recursyve-nice-data-filter-kit.mjs +19 -7
- package/fesm2020/recursyve-nice-data-filter-kit.mjs.map +1 -1
- package/lib/components/base-list/store/base-list.service.d.ts +2 -0
- 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';
|
|
@@ -1059,17 +1059,18 @@ class NiceBaseListService {
|
|
|
1059
1059
|
});
|
|
1060
1060
|
}
|
|
1061
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,
|
|
1065
1068
|
rules
|
|
1066
1069
|
};
|
|
1067
|
-
|
|
1068
|
-
this.resetPaging();
|
|
1069
|
-
}
|
|
1070
|
-
await this.loadData(newRules, updateQueryParams, reset);
|
|
1070
|
+
await this.loadData(newRules, updateQueryParams);
|
|
1071
1071
|
}
|
|
1072
1072
|
addRuleFromConfig(config) {
|
|
1073
|
+
this.resetPaging();
|
|
1073
1074
|
const { filterParameters } = this.store.getValue();
|
|
1074
1075
|
const newRules = {
|
|
1075
1076
|
...filterParameters,
|
|
@@ -1081,8 +1082,7 @@ class NiceBaseListService {
|
|
|
1081
1082
|
this.store.update({
|
|
1082
1083
|
showQueryBuilder: true
|
|
1083
1084
|
});
|
|
1084
|
-
this.
|
|
1085
|
-
this.loadData(newRules, true, true);
|
|
1085
|
+
this.loadData(newRules, true);
|
|
1086
1086
|
}
|
|
1087
1087
|
updateRules(rules) {
|
|
1088
1088
|
const { filterParameters } = this.store.getValue();
|
|
@@ -1102,6 +1102,18 @@ class NiceBaseListService {
|
|
|
1102
1102
|
showQueryBuilder: !state.showQueryBuilder
|
|
1103
1103
|
}));
|
|
1104
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(filterResult.values, value, opts)
|
|
1114
|
+
}
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1105
1117
|
updateListValue(value, key = "id") {
|
|
1106
1118
|
const { filterResult } = this.store.getValue();
|
|
1107
1119
|
if (!filterResult) {
|