@stemy/ngx-dynamic-form 19.8.23 → 19.9.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.
@@ -1,10 +1,10 @@
1
1
  import * as i2 from '@stemy/ngx-utils';
2
- import { cachedFactory, ReflectUtils, ObjectUtils, LANGUAGE_SERVICE, FactoryDependencies, ForbiddenZone, ArrayUtils, API_SERVICE, StringUtils, AsyncMethodBase, EventsService, NgxUtilsModule } from '@stemy/ngx-utils';
2
+ import { cachedFactory, ReflectUtils, ObjectUtils, LANGUAGE_SERVICE, ForbiddenZone, ArrayUtils, API_SERVICE, StringUtils, AsyncMethodBase, EventsService, NgxUtilsModule } from '@stemy/ngx-utils';
3
3
  import { of, merge, Observable, firstValueFrom, BehaviorSubject, combineLatestWith, switchMap, distinctUntilChanged, first, Subject, filter } from 'rxjs';
4
4
  import { debounceTime } from 'rxjs/operators';
5
5
  import { __decorate } from 'tslib';
6
6
  import * as i0 from '@angular/core';
7
- import { Inject, Injectable, untracked, input, inject, Renderer2, ElementRef, computed, signal, effect, HostBinding, Directive, Input, Pipe, Type, Component, output, Injector, ChangeDetectionStrategy, ViewEncapsulation, makeEnvironmentProviders, NgModule } from '@angular/core';
7
+ import { inject, Inject, Injectable, untracked, input, Renderer2, ElementRef, computed, signal, effect, HostBinding, Directive, Input, Pipe, Type, Component, output, Injector, ChangeDetectionStrategy, ViewEncapsulation, makeEnvironmentProviders, NgModule } from '@angular/core';
8
8
  import * as i1 from '@angular/forms';
9
9
  import { FormGroup as FormGroup$1, FormArray as FormArray$1, FormsModule, ReactiveFormsModule } from '@angular/forms';
10
10
  import { outputToObservable, toSignal, rxResource, outputFromObservable } from '@angular/core/rxjs-interop';
@@ -433,7 +433,8 @@ function maxValueValidation(max, each) {
433
433
  }
434
434
 
435
435
  class ModelUtils {
436
- static getLanguages(language) {
436
+ static getLanguages() {
437
+ const language = inject(LANGUAGE_SERVICE);
437
438
  return async () => {
438
439
  return language.languages.map(id => {
439
440
  return { id, label: id };
@@ -441,9 +442,6 @@ class ModelUtils {
441
442
  };
442
443
  }
443
444
  }
444
- __decorate([
445
- FactoryDependencies(LANGUAGE_SERVICE)
446
- ], ModelUtils, "getLanguages", null);
447
445
 
448
446
  class RichTranslationModel {
449
447
  lang = "";
@@ -917,7 +915,7 @@ class DynamicFormBuilderService {
917
915
  }
918
916
  getLabel(key, label, labelPrefix, parent, options, legacyPrefix = "") {
919
917
  options = options || { labelPrefix: "" };
920
- labelPrefix = labelPrefix || (!ObjectUtils.isString(options.labelPrefix) ? `` : options.labelPrefix);
918
+ labelPrefix = String(labelPrefix ?? options.labelPrefix ?? "");
921
919
  if (ObjectUtils.isFunction(options.labelCustomizer)) {
922
920
  const customLabel = options.labelCustomizer(key, label, parent, labelPrefix);
923
921
  if (ObjectUtils.isString(customLabel))
@@ -943,7 +941,7 @@ class DynamicFormBuilderService {
943
941
  }
944
942
  const disabled = ReflectUtils.resolve(data.disabled, this.injector);
945
943
  const hidden = ReflectUtils.resolve(data.hidden, this.injector);
946
- const prefix = String(data.labelPrefix ?? parent?.labelPrefix ?? "");
944
+ const prefix = data.labelPrefix ?? parent?.labelPrefix;
947
945
  const field = {
948
946
  ...this.createFormSerializer(key, data),
949
947
  fieldSet: String(data.fieldSet || ""),