@sumaris-net/ngx-components 1.5.3 → 1.5.4

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.
@@ -1146,6 +1146,32 @@
1146
1146
  });
1147
1147
  });
1148
1148
  }
1149
+ function waitForTrue(predicate, opts) {
1150
+ return __awaiter(this, void 0, void 0, function () {
1151
+ var firstTrueObservable, $timeout;
1152
+ return __generator(this, function (_a) {
1153
+ firstTrueObservable = predicate.pipe(operators.first(function (v) { return v === true; }), operators.map(function () { }) // convert to void
1154
+ );
1155
+ // Timeout (+ dueTime)
1156
+ if (opts && opts.timeout > 0) {
1157
+ $timeout = rxjs.timer(opts.timeout);
1158
+ return [2 /*return*/, rxjs.merge(rxjs.timer(opts.dueTime || 0)
1159
+ .pipe(operators.switchMap(function () { return firstTrueObservable; }), operators.takeUntil($timeout)), $timeout
1160
+ .pipe(operators.map(function () {
1161
+ throw new Error("Timeout ready() - after " + opts.timeout + "ms");
1162
+ })))
1163
+ .toPromise()];
1164
+ }
1165
+ // dueTime (without timeout)
1166
+ if (opts && opts.dueTime > 0) {
1167
+ return [2 /*return*/, rxjs.timer(opts.dueTime)
1168
+ .pipe(operators.switchMap(function () { return firstTrueObservable; }))
1169
+ .toPromise()];
1170
+ }
1171
+ return [2 /*return*/, firstTrueObservable.toPromise()];
1172
+ });
1173
+ });
1174
+ }
1149
1175
 
1150
1176
  function createPromiseEventEmitter() {
1151
1177
  return new i0.EventEmitter(true);
@@ -25927,6 +25953,8 @@
25927
25953
  };
25928
25954
  AppEditor.prototype.ngOnDestroy = function () {
25929
25955
  this._subscription.unsubscribe();
25956
+ this._$ready.complete();
25957
+ this._$ready.unsubscribe();
25930
25958
  };
25931
25959
  AppEditor.prototype.addChildForm = function (form) {
25932
25960
  if (!form)
@@ -26024,12 +26052,7 @@
26024
26052
  AppEditor.prototype.ready = function (opts) {
26025
26053
  return __awaiter(this, void 0, void 0, function () {
26026
26054
  return __generator(this, function (_b) {
26027
- switch (_b.label) {
26028
- case 0: return [4 /*yield*/, firstTruePromise(this._$ready)];
26029
- case 1:
26030
- _b.sent();
26031
- return [2 /*return*/];
26032
- }
26055
+ return [2 /*return*/, waitForTrue(this._$ready, opts)];
26033
26056
  });
26034
26057
  });
26035
26058
  };
@@ -28797,6 +28820,7 @@
28797
28820
  exports.uncapitalizeFirstLetter = uncapitalizeFirstLetter;
28798
28821
  exports.updateValueAndValidity = updateValueAndValidity;
28799
28822
  exports.waitFor = waitFor;
28823
+ exports.waitForTrue = waitForTrue;
28800
28824
  exports.waitIdle = waitIdle;
28801
28825
  exports.waitWhilePending = waitWhilePending;
28802
28826
  exports["ɵ0"] = ɵ0$5;