@universis/ngx-tables 6.13.8 → 6.14.0

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.
@@ -22,8 +22,8 @@ import { BsModalRef, BsModalService, ModalModule } from 'ngx-bootstrap/modal';
22
22
  import { ProgressbarModule } from 'ngx-bootstrap/progressbar';
23
23
  import { GroupByPipe, NgPipesModule } from 'ngx-pipes';
24
24
  import { template, at, cloneDeep, isEmpty } from 'lodash';
25
- import { __extends, __awaiter, __generator, __values, __assign, __spread } from 'tslib';
26
- import { Injectable, Directive, Optional, Input, Component, ElementRef, ViewChild, ViewEncapsulation, EventEmitter, Output, Pipe, NgModule, CUSTOM_ELEMENTS_SCHEMA, defineInjectable, inject, HostListener, ChangeDetectorRef, InjectionToken, Inject, Injector, ViewContainerRef, ChangeDetectionStrategy } from '@angular/core';
25
+ import { __extends, __awaiter, __generator, __values, __spread, __assign } from 'tslib';
26
+ import { Injectable, Directive, Optional, Input, Component, EventEmitter, Output, Pipe, ElementRef, ViewChild, ViewEncapsulation, defineInjectable, inject, NgModule, CUSTOM_ELEMENTS_SCHEMA, HostListener, ChangeDetectorRef, InjectionToken, Inject, Injector, ViewContainerRef, ErrorHandler, ChangeDetectionStrategy } from '@angular/core';
27
27
  import { ActivatedRoute, Router, NavigationStart, NavigationEnd, RouterModule } from '@angular/router';
28
28
  import { createFeatureSelector, createSelector, select, Store } from '@ngrx/store';
29
29
  import { skip, first, filter } from 'rxjs/operators';
@@ -1832,7 +1832,7 @@ function getRandomIdentifier() {
1832
1832
  return (Number(String(Math.random()).slice(2))).toString(36);
1833
1833
  }
1834
1834
  var AdvancedTableComponent = /** @class */ (function () {
1835
- function AdvancedTableComponent(_context, _columnFormatters, _activatedRoute, _translateService, _injector, _advancedFilterValueProvider, _element, _template, _loading, _http, _columnSelector, _configuration, _exportSpreadsheet, _modalService, _errorService, _viewContainerRef) {
1835
+ function AdvancedTableComponent(_context, _columnFormatters, _activatedRoute, _translateService, _injector, _advancedFilterValueProvider, _element, _template, _loading, _http, _columnSelector, _configuration, _exportSpreadsheet, _modalService, _errorService, _viewContainerRef, _errorHandler) {
1836
1836
  var _this = this;
1837
1837
  this._context = _context;
1838
1838
  this._columnFormatters = _columnFormatters;
@@ -1850,6 +1850,7 @@ var AdvancedTableComponent = /** @class */ (function () {
1850
1850
  this._modalService = _modalService;
1851
1851
  this._errorService = _errorService;
1852
1852
  this._viewContainerRef = _viewContainerRef;
1853
+ this._errorHandler = _errorHandler;
1853
1854
  this._firstLoad = true;
1854
1855
  this._showFooter = false;
1855
1856
  this._showHeader = true;
@@ -3231,7 +3232,11 @@ var AdvancedTableComponent = /** @class */ (function () {
3231
3232
  return;
3232
3233
  }
3233
3234
  /** @type {?} */
3234
- var q = this._context.model(this.config.model).asQueryable();
3235
+ var queryModel = this._query && this._query.getModel();
3236
+ /** @type {?} */
3237
+ var model = queryModel ? queryModel : this.config.model;
3238
+ /** @type {?} */
3239
+ var q = this._context.model(model).asQueryable();
3235
3240
  Object.keys(this.lastQueryParams).forEach(function (key) {
3236
3241
  q.setParam(key, _this.lastQueryParams && _this.lastQueryParams[key]);
3237
3242
  });
@@ -3427,6 +3432,19 @@ var AdvancedTableComponent = /** @class */ (function () {
3427
3432
  }
3428
3433
  if (err) {
3429
3434
  this.lastError = err;
3435
+ if (typeof err.status === 'number') {
3436
+ if (this._errorHandler) {
3437
+ // a backward compatibility assignment of rejection property
3438
+ // following @universis/common#ErrorsHandler.handleError contract
3439
+ Object.assign(err, {
3440
+ rejection: {
3441
+ status: err.status,
3442
+ statusText: err.statusText
3443
+ }
3444
+ });
3445
+ this._errorHandler.handleError(err);
3446
+ }
3447
+ }
3430
3448
  if (innerMessage) {
3431
3449
  innerMessage.innerHTML = err.error && err.error.message ? err.error.message : err.message;
3432
3450
  }
@@ -3785,7 +3803,8 @@ var AdvancedTableComponent = /** @class */ (function () {
3785
3803
  { type: ExportSpreadsheetService },
3786
3804
  { type: ModalService },
3787
3805
  { type: ErrorService },
3788
- { type: ViewContainerRef }
3806
+ { type: ViewContainerRef },
3807
+ { type: ErrorHandler, decorators: [{ type: Optional }] }
3789
3808
  ]; };
3790
3809
  AdvancedTableComponent.propDecorators = {
3791
3810
  table: [{ type: ViewChild, args: ['table',] }],