@universis/ngx-tables 6.13.6 → 6.13.7

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.
@@ -6223,7 +6223,7 @@
6223
6223
  */
6224
6224
  function () {
6225
6225
  return __awaiter(this, void 0, void 0, function () {
6226
- var expressions_1, values_1, query;
6226
+ var expressions_1, values_1, queryParams_4, query_1, param, modelName;
6227
6227
  var _this = this;
6228
6228
  return __generator(this, function (_a) {
6229
6229
  switch (_a.label) {
@@ -6238,6 +6238,7 @@
6238
6238
  return [4 /*yield*/, this._advancedSearchValueProvider.getValues()];
6239
6239
  case 1:
6240
6240
  values_1 = _a.sent();
6241
+ queryParams_4 = [];
6241
6242
  this.table.config.criteria.forEach(function (x) {
6242
6243
  if (Object.prototype.hasOwnProperty.call(_this.filter, x.name)) {
6243
6244
  /** @type {?} */
@@ -6250,22 +6251,39 @@
6250
6251
  }));
6251
6252
  }
6252
6253
  else if (_this.filter[x.name] !== 'undefined') {
6253
- expressions_1.push(_this._template.transform(x.filter, Object.assign({
6254
- value: _this.filter[x.name],
6255
- }, values_1)));
6254
+ if (x.type !== 'queryParam') {
6255
+ expressions_1.push(_this._template.transform(x.filter, Object.assign({
6256
+ value: _this.filter[x.name],
6257
+ }, values_1)));
6258
+ }
6259
+ else {
6260
+ /** @type {?} */
6261
+ var value = _this.filter[x.name];
6262
+ if (value) {
6263
+ queryParams_4.push(Object.assign(x, { value: value }));
6264
+ }
6265
+ }
6256
6266
  }
6257
6267
  }
6258
6268
  });
6259
- query = void 0;
6269
+ query_1 = void 0;
6270
+ query_1 = this._context.model(this.table.config.model).asQueryable();
6271
+ if (queryParams_4 && queryParams_4.length) {
6272
+ param = queryParams_4.find(function (x) {
6273
+ return x.model !== null;
6274
+ });
6275
+ modelName = param ? param.model : this.table.config.model;
6276
+ query_1 = this._context.model(modelName).asQueryable();
6277
+ queryParams_4.forEach(function (queryParam) {
6278
+ query_1.setParam(queryParam.queryParam, queryParam.value);
6279
+ });
6280
+ }
6260
6281
  if (expressions_1 && expressions_1.length) {
6261
6282
  // create client query
6262
- query = this._context.model(this.table.config.model).asQueryable();
6263
- query.setParam('filter', expressions_1.join(' and '));
6264
- }
6265
- else {
6266
- query = this._context.model(this.table.config.model).asQueryable();
6283
+ // create client query
6284
+ query_1.setParam('filter', expressions_1.join(' and '));
6267
6285
  }
6268
- return [2 /*return*/, query];
6286
+ return [2 /*return*/, query_1];
6269
6287
  case 2: return [2 /*return*/];
6270
6288
  }
6271
6289
  });
@@ -6292,12 +6310,12 @@
6292
6310
  if (this.mergeQueryParams && this.table) {
6293
6311
  this.selectedList = null;
6294
6312
  /** @type {?} */
6295
- var queryParams_4 = { q: null, s: null };
6313
+ var queryParams_5 = { q: null, s: null };
6296
6314
  // enumerate criteria
6297
6315
  this.table.config.criteria.forEach(function (item) {
6298
- if (Object.prototype.hasOwnProperty.call(queryParams_4, item.name) === false) {
6316
+ if (Object.prototype.hasOwnProperty.call(queryParams_5, item.name) === false) {
6299
6317
  // set null value
6300
- Object.defineProperty(queryParams_4, item.name, {
6318
+ Object.defineProperty(queryParams_5, item.name, {
6301
6319
  configurable: true,
6302
6320
  enumerable: true,
6303
6321
  writable: true,
@@ -6307,7 +6325,7 @@
6307
6325
  });
6308
6326
  return this._router.navigate([], {
6309
6327
  relativeTo: this._activatedRoute,
6310
- queryParams: queryParams_4,
6328
+ queryParams: queryParams_5,
6311
6329
  queryParamsHandling: 'merge',
6312
6330
  });
6313
6331
  }