@bizdoc/core 3.5.2 → 3.5.3

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.
@@ -9970,9 +9970,10 @@ class ComposeFormComponent {
9970
9970
  return of(false);
9971
9971
  }
9972
9972
  else if (isPromise(result))
9973
- return from(result).pipe(switchMap(() => this._save(feedback)));
9973
+ return from(result).
9974
+ pipe(switchMap(v => v ? this._save(feedback) : of(false)));
9974
9975
  else
9975
- return result.pipe(switchMap(() => this._save(feedback)));
9976
+ return result.pipe(switchMap(v => v ? this._save(feedback) : of(false)));
9976
9977
  }
9977
9978
  return this._save(feedback);
9978
9979
  }
@@ -9992,6 +9993,20 @@ class ComposeFormComponent {
9992
9993
  }
9993
9994
  submit() {
9994
9995
  this._applychanges();
9996
+ if (this._instance.onValidate) {
9997
+ const result = this._instance.onValidate();
9998
+ if (isBoolean(result)) {
9999
+ if (result === false)
10000
+ return of(false);
10001
+ }
10002
+ else if (isPromise(result))
10003
+ return from(result).pipe(switchMap(v => v ? this._submit() : of(false)));
10004
+ else
10005
+ return result.pipe(switchMap(v => v ? this._submit() : of(false)));
10006
+ }
10007
+ return this._submit();
10008
+ }
10009
+ _submit() {
9995
10010
  const { id, version, formId, model, number } = this.model;
9996
10011
  this.working = true;
9997
10012
  this.workingChange.emit(true);