@stemy/ngx-dynamic-form 19.9.9 → 19.9.11

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;
@@ -1049,11 +1049,12 @@ class DynamicFormBuilderService {
1049
1049
  const idName = String(field.id || field.key || "").replace(/\./, "-");
1050
1050
  let baseName = `dynamic-form-fieldset dynamic-form-fieldset-${idName}`;
1051
1051
  if (!this.isFieldset(target)) {
1052
+ const labelAlign = target.props?.labelAlign || "before";
1052
1053
  const type = String(target.type || "group").replace("formly-", "");
1053
1054
  const typeName = ObjectUtils.isConstructor(type)
1054
1055
  ? `${target.type.name}`.toLowerCase().replace("component", "")
1055
1056
  : type;
1056
- baseName = `dynamic-form-field dynamic-form-field-${target.key} dynamic-form-${typeName}`;
1057
+ baseName = `dynamic-form-field dynamic-form-field-${target.key} dynamic-form-label-${labelAlign} dynamic-form-${typeName}`;
1057
1058
  }
1058
1059
  const classesName = Array.isArray(classes) ? classes : [classes];
1059
1060
  const layoutName = Array.isArray(layout) ? layout : [layout];
@@ -2001,7 +2002,7 @@ class DynamicFormComponent {
2001
2002
  globalTemplatePrefix = input("dynamic-form");
2002
2003
  labelPrefix = input("label");
2003
2004
  labelCustomizer = input(null);
2004
- testId = input("");
2005
+ testId = input("form");
2005
2006
  useTabs = input(false);
2006
2007
  legacyLabels = input(false);
2007
2008
  data = input({});
@@ -2022,16 +2023,15 @@ class DynamicFormComponent {
2022
2023
  legacyLabels: this.legacyLabels(),
2023
2024
  testId: this.testId(),
2024
2025
  };
2026
+ const fields = this.fields();
2027
+ const constructor = this.data()?.constructor;
2025
2028
  return [
2026
- this.builder.createFormGroup(null, parent => {
2027
- const fields = this.fields() || this.builder.resolveFormFields(this.data()?.constructor, parent, options);
2028
- return this.builder.createFieldSets(fields, parent, options);
2029
- }, {
2029
+ this.builder.createFormGroup(null, parent => this.builder.createFieldSets(fields || this.builder.resolveFormFields(constructor, parent, options), parent), {
2030
2030
  label: "",
2031
2031
  useTabs: this.useTabs(),
2032
2032
  hidden: false,
2033
2033
  className: "dynamic-form-root-group"
2034
- }, null, options)
2034
+ })
2035
2035
  ];
2036
2036
  });
2037
2037
  group = computed(() => {