@stemy/ngx-dynamic-form 19.9.10 → 19.9.12

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.
@@ -525,7 +525,7 @@ class ConfigForSchemaWrap {
525
525
  return this.opts.legacyLabels;
526
526
  }
527
527
  get testId() {
528
- return this.opts.testId;
528
+ return this.opts.testId || "form";
529
529
  }
530
530
  get context() {
531
531
  return this.opts.context;
@@ -1071,7 +1071,7 @@ class DynamicFormBuilderService {
1071
1071
  },
1072
1072
  testId: target => {
1073
1073
  const tp = target.parent;
1074
- const prefix = !tp?.testId ? options?.testId || "form" : tp.testId;
1074
+ const prefix = !tp?.testId ? options?.testId : tp.testId;
1075
1075
  return [prefix, String(target.key ?? "")].filter(ObjectUtils.isStringWithValue).join("-");
1076
1076
  }
1077
1077
  };
@@ -2002,7 +2002,7 @@ class DynamicFormComponent {
2002
2002
  globalTemplatePrefix = input("dynamic-form");
2003
2003
  labelPrefix = input("label");
2004
2004
  labelCustomizer = input(null);
2005
- testId = input("");
2005
+ testId = input("form");
2006
2006
  useTabs = input(false);
2007
2007
  legacyLabels = input(false);
2008
2008
  data = input({});
@@ -2023,16 +2023,15 @@ class DynamicFormComponent {
2023
2023
  legacyLabels: this.legacyLabels(),
2024
2024
  testId: this.testId(),
2025
2025
  };
2026
+ const fields = this.fields();
2027
+ const constructor = this.data()?.constructor;
2026
2028
  return [
2027
- this.builder.createFormGroup(null, parent => {
2028
- const fields = this.fields() || this.builder.resolveFormFields(this.data()?.constructor, parent, options);
2029
- return this.builder.createFieldSets(fields, parent, options);
2030
- }, {
2029
+ this.builder.createFormGroup(null, parent => this.builder.createFieldSets(fields || this.builder.resolveFormFields(constructor, parent, options), parent), {
2031
2030
  label: "",
2032
2031
  useTabs: this.useTabs(),
2033
2032
  hidden: false,
2034
2033
  className: "dynamic-form-root-group"
2035
- }, null, options)
2034
+ })
2036
2035
  ];
2037
2036
  });
2038
2037
  group = computed(() => {