@universis/ngx-tables 6.13.6 → 6.13.8
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/bundles/universis-ngx-tables.umd.js +37 -17
- package/bundles/universis-ngx-tables.umd.js.map +1 -1
- package/bundles/universis-ngx-tables.umd.min.js +1 -1
- package/bundles/universis-ngx-tables.umd.min.js.map +1 -1
- package/esm2015/lib/components/advanced-table/advanced-table-search.component.js +32 -9
- package/esm5/lib/components/advanced-table/advanced-table-search.component.js +38 -18
- package/fesm2015/universis-ngx-tables.js +31 -8
- package/fesm2015/universis-ngx-tables.js.map +1 -1
- package/fesm5/universis-ngx-tables.js +38 -18
- package/fesm5/universis-ngx-tables.js.map +1 -1
- package/package.json +1 -1
|
@@ -6160,7 +6160,7 @@
|
|
|
6160
6160
|
*/
|
|
6161
6161
|
function (event) {
|
|
6162
6162
|
return __awaiter(this, void 0, void 0, function () {
|
|
6163
|
-
var query, queryParams_3;
|
|
6163
|
+
var query, queryParams_3, queryParams;
|
|
6164
6164
|
return __generator(this, function (_a) {
|
|
6165
6165
|
switch (_a.label) {
|
|
6166
6166
|
case 0:
|
|
@@ -6191,7 +6191,9 @@
|
|
|
6191
6191
|
})];
|
|
6192
6192
|
}
|
|
6193
6193
|
if (this.table.query && query && query.getParams()['$filter']) {
|
|
6194
|
-
this.table.query.
|
|
6194
|
+
queryParams = Object.assign({}, this.table.query.getParams(), query.getParams());
|
|
6195
|
+
query.setQueryParams(queryParams);
|
|
6196
|
+
this.table.query = query;
|
|
6195
6197
|
}
|
|
6196
6198
|
else {
|
|
6197
6199
|
this.table.query = query;
|
|
@@ -6223,7 +6225,7 @@
|
|
|
6223
6225
|
*/
|
|
6224
6226
|
function () {
|
|
6225
6227
|
return __awaiter(this, void 0, void 0, function () {
|
|
6226
|
-
var expressions_1, values_1,
|
|
6228
|
+
var expressions_1, values_1, queryParams_4, query_1, param, modelName;
|
|
6227
6229
|
var _this = this;
|
|
6228
6230
|
return __generator(this, function (_a) {
|
|
6229
6231
|
switch (_a.label) {
|
|
@@ -6238,6 +6240,7 @@
|
|
|
6238
6240
|
return [4 /*yield*/, this._advancedSearchValueProvider.getValues()];
|
|
6239
6241
|
case 1:
|
|
6240
6242
|
values_1 = _a.sent();
|
|
6243
|
+
queryParams_4 = [];
|
|
6241
6244
|
this.table.config.criteria.forEach(function (x) {
|
|
6242
6245
|
if (Object.prototype.hasOwnProperty.call(_this.filter, x.name)) {
|
|
6243
6246
|
/** @type {?} */
|
|
@@ -6250,22 +6253,39 @@
|
|
|
6250
6253
|
}));
|
|
6251
6254
|
}
|
|
6252
6255
|
else if (_this.filter[x.name] !== 'undefined') {
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
+
if (x.type !== 'queryParam') {
|
|
6257
|
+
expressions_1.push(_this._template.transform(x.filter, Object.assign({
|
|
6258
|
+
value: _this.filter[x.name],
|
|
6259
|
+
}, values_1)));
|
|
6260
|
+
}
|
|
6261
|
+
else {
|
|
6262
|
+
/** @type {?} */
|
|
6263
|
+
var value = _this.filter[x.name];
|
|
6264
|
+
if (value) {
|
|
6265
|
+
queryParams_4.push(Object.assign(x, { value: value }));
|
|
6266
|
+
}
|
|
6267
|
+
}
|
|
6256
6268
|
}
|
|
6257
6269
|
}
|
|
6258
6270
|
});
|
|
6259
|
-
|
|
6271
|
+
query_1 = void 0;
|
|
6272
|
+
query_1 = this._context.model(this.table.config.model).asQueryable();
|
|
6273
|
+
if (queryParams_4 && queryParams_4.length) {
|
|
6274
|
+
param = queryParams_4.find(function (x) {
|
|
6275
|
+
return x.model !== null;
|
|
6276
|
+
});
|
|
6277
|
+
modelName = param ? param.model : this.table.config.model;
|
|
6278
|
+
query_1 = this._context.model(modelName).asQueryable();
|
|
6279
|
+
queryParams_4.forEach(function (queryParam) {
|
|
6280
|
+
query_1.setParam(queryParam.queryParam, queryParam.value);
|
|
6281
|
+
});
|
|
6282
|
+
}
|
|
6260
6283
|
if (expressions_1 && expressions_1.length) {
|
|
6261
6284
|
// create client query
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
}
|
|
6265
|
-
else {
|
|
6266
|
-
query = this._context.model(this.table.config.model).asQueryable();
|
|
6285
|
+
// create client query
|
|
6286
|
+
query_1.setParam('filter', expressions_1.join(' and '));
|
|
6267
6287
|
}
|
|
6268
|
-
return [2 /*return*/,
|
|
6288
|
+
return [2 /*return*/, query_1];
|
|
6269
6289
|
case 2: return [2 /*return*/];
|
|
6270
6290
|
}
|
|
6271
6291
|
});
|
|
@@ -6292,12 +6312,12 @@
|
|
|
6292
6312
|
if (this.mergeQueryParams && this.table) {
|
|
6293
6313
|
this.selectedList = null;
|
|
6294
6314
|
/** @type {?} */
|
|
6295
|
-
var
|
|
6315
|
+
var queryParams_5 = { q: null, s: null };
|
|
6296
6316
|
// enumerate criteria
|
|
6297
6317
|
this.table.config.criteria.forEach(function (item) {
|
|
6298
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
6318
|
+
if (Object.prototype.hasOwnProperty.call(queryParams_5, item.name) === false) {
|
|
6299
6319
|
// set null value
|
|
6300
|
-
Object.defineProperty(
|
|
6320
|
+
Object.defineProperty(queryParams_5, item.name, {
|
|
6301
6321
|
configurable: true,
|
|
6302
6322
|
enumerable: true,
|
|
6303
6323
|
writable: true,
|
|
@@ -6307,7 +6327,7 @@
|
|
|
6307
6327
|
});
|
|
6308
6328
|
return this._router.navigate([], {
|
|
6309
6329
|
relativeTo: this._activatedRoute,
|
|
6310
|
-
queryParams:
|
|
6330
|
+
queryParams: queryParams_5,
|
|
6311
6331
|
queryParamsHandling: 'merge',
|
|
6312
6332
|
});
|
|
6313
6333
|
}
|