@ziadshalaby/ngx-zs-component 3.1.0 → 3.1.1

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.
@@ -1294,11 +1294,12 @@ class Form {
1294
1294
  }
1295
1295
  return result;
1296
1296
  }
1297
- submit(callback) {
1297
+ submit(callback, submitWhenAllNotFilled = false) {
1298
1298
  this.markAllTouched();
1299
1299
  const allFilled = this.allFilled();
1300
- const allValid = Object.values(this.getValidations()).every(v => v === true);
1301
- if (!allFilled || !allValid)
1300
+ const validations = this.getValidations();
1301
+ const allValid = Object.values(validations).every(Boolean);
1302
+ if ((!submitWhenAllNotFilled && !allFilled) || !allValid)
1302
1303
  return;
1303
1304
  callback(this.getValues());
1304
1305
  }