@lenne.tech/ng-base 14.13.0 → 14.13.2

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.
@@ -2025,14 +2025,22 @@ class FormsService {
2025
2025
  });
2026
2026
  }
2027
2027
  findInvalidControls(formGroup) {
2028
- const invalid = [];
2028
+ return this.getInvalidControl(formGroup);
2029
+ }
2030
+ getInvalidControl(formGroup, invalid) {
2031
+ let result = invalid ? [...invalid] : [];
2029
2032
  const controls = formGroup.controls;
2030
2033
  Object.keys(formGroup.controls).forEach((name) => {
2031
2034
  if (controls[name].invalid) {
2032
- invalid.push(name);
2035
+ if (controls[name]?.controls) {
2036
+ result = this.getInvalidControl(controls[name], result);
2037
+ }
2038
+ else {
2039
+ result.push(name);
2040
+ }
2033
2041
  }
2034
2042
  });
2035
- return invalid;
2043
+ return result;
2036
2044
  }
2037
2045
  scrollToInvalidControl(form) {
2038
2046
  const invalidForm = this.findInvalidControls(form)[0];
@@ -2438,7 +2446,6 @@ class FileService {
2438
2446
  */
2439
2447
  async upload(url, path, file, compressOptions) {
2440
2448
  return new Promise(async (resolve, reject) => {
2441
- console.log(url, path, compressOptions, file);
2442
2449
  if (compressOptions) {
2443
2450
  file = await this.compress(file, compressOptions);
2444
2451
  }
@@ -2558,7 +2565,7 @@ function fullEmail() {
2558
2565
 
2559
2566
  function securePasswordValidator() {
2560
2567
  return (control) => {
2561
- const PASSWORD_REGEX = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/i;
2568
+ const PASSWORD_REGEX = /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/i;
2562
2569
  return !PASSWORD_REGEX.test(control.value) ? { invalidSecurePassword: true } : null;
2563
2570
  };
2564
2571
  }