@universis/ngx-tables 0.8.1 → 0.8.2
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 +17 -5
- 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/tables.activated-table.service.js +16 -2
- package/esm5/lib/tables.activated-table.service.js +16 -2
- package/fesm2015/universis-ngx-tables.js +16 -4
- package/fesm2015/universis-ngx-tables.js.map +1 -1
- package/fesm5/universis-ngx-tables.js +16 -4
- package/fesm5/universis-ngx-tables.js.map +1 -1
- package/lib/tables.activated-table.service.d.ts +11 -0
- package/package.json +1 -1
- package/universis-ngx-tables.metadata.json +1 -1
|
@@ -24,7 +24,7 @@ import { __extends, __awaiter, __generator, __values, __assign, __spread } from
|
|
|
24
24
|
import { Injectable, Directive, Optional, Input, Pipe, Component, ElementRef, ViewChild, ViewEncapsulation, EventEmitter, Output, NgModule, CUSTOM_ELEMENTS_SCHEMA, defineInjectable, inject, HostListener, ChangeDetectorRef, InjectionToken, Inject, Injector, ChangeDetectionStrategy } from '@angular/core';
|
|
25
25
|
import { ActivatedRoute, Router, NavigationStart, NavigationEnd, RouterModule } from '@angular/router';
|
|
26
26
|
import { createFeatureSelector, createSelector, select, Store } from '@ngrx/store';
|
|
27
|
-
import { first, filter } from 'rxjs/operators';
|
|
27
|
+
import { skip, first, filter } from 'rxjs/operators';
|
|
28
28
|
|
|
29
29
|
var AdvancedColumnFormatter = /** @class */ (function () {
|
|
30
30
|
function AdvancedColumnFormatter() {
|
|
@@ -825,10 +825,20 @@ var ActivatedTableService = /** @class */ (function () {
|
|
|
825
825
|
var _this = this;
|
|
826
826
|
this._router = _router;
|
|
827
827
|
this._activatedRoute = _activatedRoute;
|
|
828
|
+
/**
|
|
829
|
+
* Get the last table that was set as active
|
|
830
|
+
* Note: Emitted value may be null (e.g. reset on route changes)
|
|
831
|
+
*/
|
|
832
|
+
this.lastActiveTable = new BehaviorSubject(null);
|
|
833
|
+
/**
|
|
834
|
+
* Omit the last emitted value to observe only new active table changes
|
|
835
|
+
* Note: Emitted value may be null (e.g. reset on route changes)
|
|
836
|
+
*/
|
|
837
|
+
this.nextActiveTable = this.lastActiveTable.pipe(skip(1));
|
|
828
838
|
_router.events.forEach(function (event) {
|
|
829
839
|
if (event instanceof NavigationStart) {
|
|
830
840
|
if (_this._activeTable) {
|
|
831
|
-
_this.
|
|
841
|
+
_this.activeTable = null;
|
|
832
842
|
}
|
|
833
843
|
}
|
|
834
844
|
});
|
|
@@ -839,6 +849,8 @@ var ActivatedTableService = /** @class */ (function () {
|
|
|
839
849
|
},
|
|
840
850
|
set: function (tableComponent) {
|
|
841
851
|
this._activeTable = tableComponent;
|
|
852
|
+
// provide change to observers
|
|
853
|
+
this.lastActiveTable.next(this._activeTable);
|
|
842
854
|
},
|
|
843
855
|
enumerable: true,
|
|
844
856
|
configurable: true
|
|
@@ -1909,7 +1921,7 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
1909
1921
|
// get order expression
|
|
1910
1922
|
var order = aoData[2].value;
|
|
1911
1923
|
// get skip records param
|
|
1912
|
-
var skip = aoData[3].value;
|
|
1924
|
+
var skip$$1 = aoData[3].value;
|
|
1913
1925
|
// get page size param
|
|
1914
1926
|
var top = aoData[4].value;
|
|
1915
1927
|
// get search value
|
|
@@ -1918,7 +1930,7 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
1918
1930
|
var q = self._query instanceof ClientDataQueryable ? self._query : self._context.model(self.config.model).asQueryable();
|
|
1919
1931
|
// apply paging params
|
|
1920
1932
|
if (top) {
|
|
1921
|
-
q.take(top).skip(skip);
|
|
1933
|
+
q.take(top).skip(skip$$1);
|
|
1922
1934
|
}
|
|
1923
1935
|
// apply order params
|
|
1924
1936
|
if (order && order.length) {
|