@recursyve/nice-data-filter-kit 14.0.2 → 14.0.3
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/api/filter.api.mjs +46 -39
- package/fesm2015/recursyve-nice-data-filter-kit.mjs +42 -39
- package/fesm2015/recursyve-nice-data-filter-kit.mjs.map +1 -1
- package/fesm2020/recursyve-nice-data-filter-kit.mjs +45 -39
- package/fesm2020/recursyve-nice-data-filter-kit.mjs.map +1 -1
- package/lib/api/filter.api.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { plainToInstance } from 'class-transformer';
|
|
2
|
+
import { map, takeUntil, debounceTime, switchMap, distinctUntilChanged } from 'rxjs/operators';
|
|
1
3
|
import { HttpParams } from '@angular/common/http';
|
|
2
4
|
import * as i5$1 from '@recursyve/nice-ui-kit.v2';
|
|
3
5
|
import { isNullOrUndefined, ObjectUtils, FileUtils, ArrayUtils, ExportBottomSheetComponent, NiceLoadingSpinnerModule, NiceTypeaheadModule, NiceExportBottomSheetModule } from '@recursyve/nice-ui-kit.v2';
|
|
@@ -5,7 +7,6 @@ import * as i0 from '@angular/core';
|
|
|
5
7
|
import { Directive, Input, NgModule, Injectable, Inject, InjectionToken, Optional, Pipe, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Output, HostListener, forwardRef, TemplateRef, ContentChild, ContentChildren } from '@angular/core';
|
|
6
8
|
import { Store, StoreConfig, Query, arrayAdd, arrayUpsert, arrayRemove } from '@datorama/akita';
|
|
7
9
|
import { combineLatest, Subject, firstValueFrom, of } from 'rxjs';
|
|
8
|
-
import { map, takeUntil, debounceTime, switchMap, distinctUntilChanged } from 'rxjs/operators';
|
|
9
10
|
import { __decorate, __metadata } from 'tslib';
|
|
10
11
|
import * as i2 from '@angular/router';
|
|
11
12
|
import { RouterModule } from '@angular/router';
|
|
@@ -168,47 +169,52 @@ class NiceFilterApi {
|
|
|
168
169
|
return [routeOfQueryParams ?? "", query];
|
|
169
170
|
}
|
|
170
171
|
}
|
|
171
|
-
|
|
172
|
-
return
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
downloadData(type, queryModel) {
|
|
180
|
-
return this.post(`download/${type}`, queryModel, { responseType: "blob" });
|
|
181
|
-
}
|
|
182
|
-
getPrintableHtml(queryModel) {
|
|
183
|
-
return this.post(`download/html`, queryModel, { responseType: "text" });
|
|
184
|
-
}
|
|
185
|
-
getFilterConfig(option = {}) {
|
|
186
|
-
return this.get("filter/config", option);
|
|
187
|
-
}
|
|
188
|
-
searchFilterValue(id, value) {
|
|
189
|
-
if (value === undefined) {
|
|
190
|
-
value = "";
|
|
172
|
+
const mixinNiceFilterApi = (model) => {
|
|
173
|
+
return (base) => {
|
|
174
|
+
return class extends base {
|
|
175
|
+
filter(queryModel, option = {}) {
|
|
176
|
+
return this.post("filter", queryModel, option).pipe(map(x => model ? ({
|
|
177
|
+
...x,
|
|
178
|
+
values: plainToInstance(model, x.values)
|
|
179
|
+
}) : x));
|
|
191
180
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
181
|
+
filterCount(queryModel) {
|
|
182
|
+
return this.post("filter-count", queryModel);
|
|
183
|
+
}
|
|
184
|
+
downloadData(type, queryModel) {
|
|
185
|
+
return this.post(`download/${type}`, queryModel, { responseType: "blob" });
|
|
186
|
+
}
|
|
187
|
+
getPrintableHtml(queryModel) {
|
|
188
|
+
return this.post(`download/html`, queryModel, { responseType: "text" });
|
|
189
|
+
}
|
|
190
|
+
getFilterConfig(option = {}) {
|
|
191
|
+
return this.get("filter/config", option);
|
|
192
|
+
}
|
|
193
|
+
searchFilterValue(id, value) {
|
|
194
|
+
if (value === undefined) {
|
|
195
|
+
value = "";
|
|
204
196
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
197
|
+
return this.get("filter/config/value", {
|
|
198
|
+
params: {
|
|
199
|
+
id,
|
|
200
|
+
value
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
searchFilterResourceValue(id, resourceId) {
|
|
205
|
+
return this.get("filter/config/id", {
|
|
206
|
+
params: {
|
|
207
|
+
id,
|
|
208
|
+
resourceId
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
constructor(...args) {
|
|
213
|
+
super(...args);
|
|
214
|
+
}
|
|
215
|
+
};
|
|
210
216
|
};
|
|
211
|
-
}
|
|
217
|
+
};
|
|
212
218
|
|
|
213
219
|
class NiceBaseListButtonsDirective {
|
|
214
220
|
constructor(template) {
|