easy-forms-core 1.1.16 → 1.1.17

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.
@@ -602,7 +602,7 @@ declare class EasyForm extends BrowserHTMLElement {
602
602
  */
603
603
  private updateSingleField;
604
604
  /**
605
- * Busca un campo por nombre en el schema
605
+ * Busca un campo por nombre en el schema (soporta rutas como 'group.subfield')
606
606
  */
607
607
  private findFieldInSchema;
608
608
  /**
package/dist/easy-form.js CHANGED
@@ -6476,7 +6476,9 @@ var EasyForm = class extends BrowserHTMLElement {
6476
6476
  content.className = "easy-form-group-content";
6477
6477
  if ("fields" in field && field.fields) {
6478
6478
  for (const subField of field.fields) {
6479
- const fieldElement = this.renderField(subField);
6479
+ const fullName = subField.name.startsWith(field.name + ".") ? subField.name : `${field.name}.${subField.name}`;
6480
+ const subFieldWithPath = { ...subField, name: fullName };
6481
+ const fieldElement = this.renderField(subFieldWithPath);
6480
6482
  if (fieldElement) {
6481
6483
  content.appendChild(fieldElement);
6482
6484
  }
@@ -6519,7 +6521,9 @@ var EasyForm = class extends BrowserHTMLElement {
6519
6521
  }
6520
6522
  if ("fields" in field && field.fields) {
6521
6523
  for (const subField of field.fields) {
6522
- const fieldElement = this.renderField(subField);
6524
+ const fullName = subField.name.startsWith(field.name + ".") ? subField.name : `${field.name}.${subField.name}`;
6525
+ const subFieldWithPath = { ...subField, name: fullName };
6526
+ const fieldElement = this.renderField(subFieldWithPath);
6523
6527
  if (fieldElement) {
6524
6528
  groupContainer.appendChild(fieldElement);
6525
6529
  }
@@ -6912,10 +6916,22 @@ var EasyForm = class extends BrowserHTMLElement {
6912
6916
  }
6913
6917
  }
6914
6918
  /**
6915
- * Busca un campo por nombre en el schema
6919
+ * Busca un campo por nombre en el schema (soporta rutas como 'group.subfield')
6916
6920
  */
6917
6921
  findFieldInSchema(schema, name) {
6918
6922
  const fields = schema.fields || [];
6923
+ const dot = name.indexOf(".");
6924
+ if (dot > 0) {
6925
+ const parentName = name.slice(0, dot);
6926
+ const childName = name.slice(dot + 1);
6927
+ const parent = fields.find((f) => f.name === parentName);
6928
+ if (!parent) return null;
6929
+ if ((parent.type === "group" || parent.type === "row") && "fields" in parent && parent.fields) {
6930
+ const found = this.findFieldInSchema({ fields: parent.fields }, childName);
6931
+ return found ? { ...found, name } : null;
6932
+ }
6933
+ return null;
6934
+ }
6919
6935
  for (const field of fields) {
6920
6936
  if (field.name === name) {
6921
6937
  return field;