@sumaris-net/ngx-components 1.23.15 → 1.23.16
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/sumaris-net.ngx-components.umd.js +30 -20
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/esm2015/src/app/shared/services/memory-entity-service.class.js +16 -8
- package/fesm2015/sumaris-net.ngx-components.js +15 -7
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/shared/services/memory-entity-service.class.d.ts +1 -1
|
@@ -20853,10 +20853,11 @@
|
|
|
20853
20853
|
return __generator(this, function (_b) {
|
|
20854
20854
|
if (this.debug)
|
|
20855
20855
|
console.debug('[memory-data-service] Stopping...');
|
|
20856
|
-
this.savingSubject.next(false);
|
|
20857
|
-
this.dirtySubject.next(false);
|
|
20858
20856
|
this.dataSubject.complete();
|
|
20857
|
+
this.dataSubject.unsubscribe();
|
|
20859
20858
|
this.dataSubject = new rxjs.BehaviorSubject(null);
|
|
20859
|
+
this.savingSubject.next(false);
|
|
20860
|
+
this.dirtySubject.next(false);
|
|
20860
20861
|
return [2 /*return*/];
|
|
20861
20862
|
});
|
|
20862
20863
|
});
|
|
@@ -20886,32 +20887,40 @@
|
|
|
20886
20887
|
if (isNil(originalData)) {
|
|
20887
20888
|
console.warn('[memory-data-service] Cannot load all: no value set. Will return empty result');
|
|
20888
20889
|
}
|
|
20889
|
-
|
|
20890
|
-
return [4 /*yield*/, this.ready()];
|
|
20890
|
+
_b.label = 1;
|
|
20891
20891
|
case 1:
|
|
20892
|
-
_b.
|
|
20893
|
-
|
|
20892
|
+
_b.trys.push([1, , 6, 7]);
|
|
20893
|
+
if (!!this.started) return [3 /*break*/, 3];
|
|
20894
|
+
return [4 /*yield*/, this.ready()];
|
|
20894
20895
|
case 2:
|
|
20895
|
-
if (!this.saving) return [3 /*break*/, 4];
|
|
20896
|
-
return [4 /*yield*/, this.waitWhileSaving()];
|
|
20897
|
-
case 3:
|
|
20898
20896
|
_b.sent();
|
|
20899
|
-
_b.label =
|
|
20897
|
+
_b.label = 3;
|
|
20898
|
+
case 3:
|
|
20899
|
+
if (!this.saving) return [3 /*break*/, 5];
|
|
20900
|
+
return [4 /*yield*/, this.waitWhileSaving()];
|
|
20900
20901
|
case 4:
|
|
20901
|
-
|
|
20902
|
+
_b.sent();
|
|
20902
20903
|
_b.label = 5;
|
|
20903
|
-
case 5:
|
|
20904
|
-
|
|
20904
|
+
case 5: return [3 /*break*/, 7];
|
|
20905
|
+
case 6:
|
|
20906
|
+
if (!this.started)
|
|
20907
|
+
return [2 /*return*/, undefined]; // Stopped (e.g. after saved)
|
|
20908
|
+
return [7 /*endfinally*/];
|
|
20909
|
+
case 7:
|
|
20910
|
+
excludedDataByFilter = [];
|
|
20911
|
+
_b.label = 8;
|
|
20912
|
+
case 8:
|
|
20913
|
+
_b.trys.push([8, , 11, 12]);
|
|
20905
20914
|
if (isEmptyArray(originalData)) {
|
|
20906
20915
|
return [2 /*return*/, { data: [], total: 0 }];
|
|
20907
20916
|
}
|
|
20908
20917
|
data = this._sortFn(originalData, sortBy, sortDirection);
|
|
20909
|
-
if (!this._onLoad) return [3 /*break*/,
|
|
20918
|
+
if (!this._onLoad) return [3 /*break*/, 10];
|
|
20910
20919
|
return [4 /*yield*/, this._onLoad(data)];
|
|
20911
|
-
case
|
|
20920
|
+
case 9:
|
|
20912
20921
|
data = _b.sent();
|
|
20913
|
-
_b.label =
|
|
20914
|
-
case
|
|
20922
|
+
_b.label = 10;
|
|
20923
|
+
case 10:
|
|
20915
20924
|
// Apply filter (will update hiddenData)
|
|
20916
20925
|
data = this.filter(data, filter, excludedDataByFilter);
|
|
20917
20926
|
total = data.length;
|
|
@@ -20968,13 +20977,13 @@
|
|
|
20968
20977
|
}); };
|
|
20969
20978
|
}
|
|
20970
20979
|
return [2 /*return*/, res];
|
|
20971
|
-
case
|
|
20980
|
+
case 11:
|
|
20972
20981
|
// Remember hidden data
|
|
20973
20982
|
if (offset === 0) {
|
|
20974
20983
|
this._hiddenData = !excludedDataByPagination ? excludedDataByFilter : excludedDataByFilter.concat.apply(excludedDataByFilter, __spread(excludedDataByPagination));
|
|
20975
20984
|
}
|
|
20976
20985
|
return [7 /*endfinally*/];
|
|
20977
|
-
case
|
|
20986
|
+
case 12: return [2 /*return*/];
|
|
20978
20987
|
}
|
|
20979
20988
|
});
|
|
20980
20989
|
});
|
|
@@ -20986,7 +20995,8 @@
|
|
|
20986
20995
|
return this.dataSubject
|
|
20987
20996
|
.pipe(operators.takeUntil(this.stopSubject),
|
|
20988
20997
|
// Warn if waiting value to be set
|
|
20989
|
-
operators.tap(function (data) { return _this.debug && !data && console.debug('[memory-data-service] Waiting value to be set...'); }), operators.filter(isNotNil), operators.mergeMap(function (_) { return _this.loadAll(offset, size, sortBy, sortDirection, filterData, options); }))
|
|
20998
|
+
operators.tap(function (data) { return _this.debug && !data && console.debug('[memory-data-service] Waiting value to be set...'); }), operators.filter(isNotNil), operators.mergeMap(function (_) { return _this.loadAll(offset, size, sortBy, sortDirection, filterData, options); }), operators.filter(isNotNil) // Skip no result (e.g. when stopped)
|
|
20999
|
+
);
|
|
20990
21000
|
};
|
|
20991
21001
|
InMemoryEntitiesService.prototype.saveAll = function (data, options) {
|
|
20992
21002
|
return __awaiter(this, void 0, void 0, function () {
|