@sumaris-net/ngx-components 0.27.7 → 0.27.8

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.
@@ -1046,24 +1046,35 @@
1046
1046
  * @param opts
1047
1047
  */
1048
1048
  function waitFor(predicate, opts) {
1049
- if (predicate())
1050
- return Promise.resolve(true);
1051
- var period = opts && opts.checkPeriod || 300;
1052
- var dueTime = opts && opts.dueTime || period;
1053
- var wait$ = rxjs.timer(dueTime, period)
1054
- .pipe(
1055
- // For DEBUG :
1056
- //tap(() => console.debug("Waiting form idle...", form)),
1057
- operators.filter(function (_) { return predicate(); }), operators.map(function (_) { return true; }));
1058
- // Add timeout
1059
- if (opts && opts.timeout) {
1060
- var $timeout = rxjs.timer(opts.timeout);
1061
- wait$ = rxjs.merge(wait$.pipe(operators.takeUntil($timeout)), $timeout
1062
- .pipe(operators.map(function () {
1063
- throw new Error("Timeout waitIdle() - after " + opts.timeout + "ms");
1064
- })));
1065
- }
1066
- return firstNotNilPromise(wait$);
1049
+ return __awaiter(this, void 0, void 0, function () {
1050
+ var period, dueTime, wait$, $timeout;
1051
+ return __generator(this, function (_a) {
1052
+ switch (_a.label) {
1053
+ case 0:
1054
+ if (predicate())
1055
+ return [2 /*return*/, Promise.resolve()];
1056
+ period = opts && opts.checkPeriod || 300;
1057
+ dueTime = opts && opts.dueTime || period;
1058
+ wait$ = rxjs.timer(dueTime, period)
1059
+ .pipe(
1060
+ // For DEBUG :
1061
+ //tap(() => console.debug("Waiting form idle...", form)),
1062
+ operators.filter(function (_) { return predicate(); }), operators.map(function (_) { return true; }));
1063
+ // Add timeout
1064
+ if (opts && opts.timeout) {
1065
+ $timeout = rxjs.timer(opts.timeout);
1066
+ wait$ = rxjs.merge(wait$.pipe(operators.takeUntil($timeout)), $timeout
1067
+ .pipe(operators.map(function () {
1068
+ throw new Error("Timeout waitIdle() - after " + opts.timeout + "ms");
1069
+ })));
1070
+ }
1071
+ return [4 /*yield*/, firstNotNilPromise(wait$)];
1072
+ case 1:
1073
+ _a.sent();
1074
+ return [2 /*return*/];
1075
+ }
1076
+ });
1077
+ });
1067
1078
  }
1068
1079
 
1069
1080
  function createPromiseEventEmitter() {
@@ -3471,6 +3482,9 @@
3471
3482
  AppFormProvider.prototype.ready = function () {
3472
3483
  return this.delegate.ready();
3473
3484
  };
3485
+ AppFormProvider.prototype.waitIdle = function (opts) {
3486
+ return this.delegate.waitIdle();
3487
+ };
3474
3488
  AppFormProvider.prototype.disable = function (opts) {
3475
3489
  return this.delegate.disable(opts);
3476
3490
  };
@@ -19259,14 +19273,27 @@
19259
19273
  * @param opts
19260
19274
  */
19261
19275
  AppForm.prototype.ready = function (opts) {
19262
- return firstTruePromise(this._$ready);
19276
+ return __awaiter(this, void 0, void 0, function () {
19277
+ return __generator(this, function (_b) {
19278
+ switch (_b.label) {
19279
+ case 0: return [4 /*yield*/, firstTruePromise(this._$ready)];
19280
+ case 1:
19281
+ _b.sent();
19282
+ return [2 /*return*/];
19283
+ }
19284
+ });
19285
+ });
19263
19286
  };
19264
19287
  /**
19265
19288
  * Wait form is idle (not loading)
19266
19289
  * @param opts
19267
19290
  */
19268
19291
  AppForm.prototype.waitIdle = function (opts) {
19269
- return AppFormUtils.waitIdle(this, opts);
19292
+ return __awaiter(this, void 0, void 0, function () {
19293
+ return __generator(this, function (_b) {
19294
+ return [2 /*return*/, AppFormUtils.waitIdle(this, opts)];
19295
+ });
19296
+ });
19270
19297
  };
19271
19298
  AppForm.prototype.updateValueAndValidity = function (opts) {
19272
19299
  AppFormUtils.updateValueAndValidity(this.form, opts);
@@ -24512,10 +24539,28 @@
24512
24539
  this.dataSource.move(id, direction);
24513
24540
  };
24514
24541
  AppTable.prototype.ready = function () {
24515
- return firstTruePromise(this.readySubject);
24542
+ return __awaiter(this, void 0, void 0, function () {
24543
+ return __generator(this, function (_d) {
24544
+ switch (_d.label) {
24545
+ case 0: return [4 /*yield*/, firstTruePromise(this.readySubject)];
24546
+ case 1:
24547
+ _d.sent();
24548
+ return [2 /*return*/];
24549
+ }
24550
+ });
24551
+ });
24516
24552
  };
24517
- AppTable.prototype.waitIdle = function () {
24518
- return firstFalsePromise(this.loadingSubject);
24553
+ AppTable.prototype.waitIdle = function (opts) {
24554
+ return __awaiter(this, void 0, void 0, function () {
24555
+ return __generator(this, function (_d) {
24556
+ switch (_d.label) {
24557
+ case 0: return [4 /*yield*/, firstFalsePromise(this.loadingSubject)];
24558
+ case 1:
24559
+ _d.sent();
24560
+ return [2 /*return*/];
24561
+ }
24562
+ });
24563
+ });
24519
24564
  };
24520
24565
  AppTable.prototype.openSelectColumnsModal = function (event) {
24521
24566
  return __awaiter(this, void 0, void 0, function () {
@@ -25502,7 +25547,16 @@
25502
25547
  this._$ready.next(true);
25503
25548
  };
25504
25549
  AppEditor.prototype.ready = function (opts) {
25505
- return firstTruePromise(this._$ready);
25550
+ return __awaiter(this, void 0, void 0, function () {
25551
+ return __generator(this, function (_b) {
25552
+ switch (_b.label) {
25553
+ case 0: return [4 /*yield*/, firstTruePromise(this._$ready)];
25554
+ case 1:
25555
+ _b.sent();
25556
+ return [2 /*return*/];
25557
+ }
25558
+ });
25559
+ });
25506
25560
  };
25507
25561
  AppEditor.prototype.waitIdle = function (opts) {
25508
25562
  return AppFormUtils.waitIdle(this, opts);