@stemy/ngx-dynamic-form 19.9.27 → 19.9.29

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.
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
2
2
  import { InjectionToken, inject, Inject, Injectable, untracked, input, Renderer2, ElementRef, computed, signal, effect, HostBinding, Directive, Input, Optional, Pipe, Type, Component, Injector, output, ChangeDetectionStrategy, ViewEncapsulation, viewChild, makeEnvironmentProviders, NgModule } from '@angular/core';
3
3
  import * as i2 from '@stemy/ngx-utils';
4
4
  import { cachedFactory, ReflectUtils, ObjectUtils, LANGUAGE_SERVICE, ForbiddenZone, SetUtils, ArrayUtils, API_SERVICE, StringUtils, AsyncMethodBase, EventsService, NgxUtilsModule } from '@stemy/ngx-utils';
5
- import { of, merge, map, Observable, firstValueFrom, BehaviorSubject, combineLatestWith, switchMap, distinctUntilChanged, first, Subject, filter } from 'rxjs';
5
+ import { of, merge, Observable, firstValueFrom, BehaviorSubject, combineLatestWith, switchMap, distinctUntilChanged, first, Subject, map, filter } from 'rxjs';
6
6
  import { debounceTime } from 'rxjs/operators';
7
7
  import * as i1 from '@angular/forms';
8
8
  import { FormGroup as FormGroup$1, FormArray as FormArray$1, FormsModule, ReactiveFormsModule } from '@angular/forms';
@@ -130,10 +130,7 @@ function replaceSpecialChars(str, to = "-") {
130
130
  function controlValues(control, timeout = 500) {
131
131
  const initial$ = of(control.value); // Emit immediately
132
132
  const changes$ = control.valueChanges.pipe(debounceTime(timeout));
133
- return merge(initial$, changes$).pipe(map(value => {
134
- console.log(value, "why");
135
- return value;
136
- }));
133
+ return merge(initial$, changes$);
137
134
  }
138
135
  /**
139
136
  * Creates a new observable that always starts with the controls current status.
@@ -461,11 +458,13 @@ function enumValidation($enum) {
461
458
  return $enum.includes(v);
462
459
  }, "enum");
463
460
  }
464
- function setFieldMinDate(field, min) {
461
+ function setFieldMinDate(field, min, setValue = true) {
465
462
  setFieldDefault(field, min);
466
463
  setFieldProp(field, "min", min);
467
- setFieldValue(field, min);
468
464
  addFieldValidators(field, [minValueValidation()]);
465
+ if (!setValue)
466
+ return;
467
+ setFieldValue(field, min);
469
468
  }
470
469
 
471
470
  class ModelUtils {