easy-forms-core 1.1.15 → 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.
package/dist/index.d.ts CHANGED
@@ -651,7 +651,7 @@ declare class EasyForm extends BrowserHTMLElement {
651
651
  */
652
652
  private updateSingleField;
653
653
  /**
654
- * Busca un campo por nombre en el schema
654
+ * Busca un campo por nombre en el schema (soporta rutas como 'group.subfield')
655
655
  */
656
656
  private findFieldInSchema;
657
657
  /**
package/dist/index.js CHANGED
@@ -550,7 +550,7 @@ function getBaseStyles(colors) {
550
550
  user-select: none;
551
551
  transition: background-color 0.2s ease;
552
552
  width: 100%;
553
- border none;
553
+ border: none;
554
554
  }
555
555
  .easy-form-group-collapsible .easy-form-group-header:hover {
556
556
  background: rgba(0, 0, 0, 0.03);
@@ -6485,7 +6485,9 @@ var EasyForm = class extends BrowserHTMLElement {
6485
6485
  content.className = "easy-form-group-content";
6486
6486
  if ("fields" in field && field.fields) {
6487
6487
  for (const subField of field.fields) {
6488
- const fieldElement = this.renderField(subField);
6488
+ const fullName = subField.name.startsWith(field.name + ".") ? subField.name : `${field.name}.${subField.name}`;
6489
+ const subFieldWithPath = { ...subField, name: fullName };
6490
+ const fieldElement = this.renderField(subFieldWithPath);
6489
6491
  if (fieldElement) {
6490
6492
  content.appendChild(fieldElement);
6491
6493
  }
@@ -6528,7 +6530,9 @@ var EasyForm = class extends BrowserHTMLElement {
6528
6530
  }
6529
6531
  if ("fields" in field && field.fields) {
6530
6532
  for (const subField of field.fields) {
6531
- const fieldElement = this.renderField(subField);
6533
+ const fullName = subField.name.startsWith(field.name + ".") ? subField.name : `${field.name}.${subField.name}`;
6534
+ const subFieldWithPath = { ...subField, name: fullName };
6535
+ const fieldElement = this.renderField(subFieldWithPath);
6532
6536
  if (fieldElement) {
6533
6537
  groupContainer.appendChild(fieldElement);
6534
6538
  }
@@ -6921,10 +6925,22 @@ var EasyForm = class extends BrowserHTMLElement {
6921
6925
  }
6922
6926
  }
6923
6927
  /**
6924
- * Busca un campo por nombre en el schema
6928
+ * Busca un campo por nombre en el schema (soporta rutas como 'group.subfield')
6925
6929
  */
6926
6930
  findFieldInSchema(schema, name) {
6927
6931
  const fields = schema.fields || [];
6932
+ const dot = name.indexOf(".");
6933
+ if (dot > 0) {
6934
+ const parentName = name.slice(0, dot);
6935
+ const childName = name.slice(dot + 1);
6936
+ const parent = fields.find((f) => f.name === parentName);
6937
+ if (!parent) return null;
6938
+ if ((parent.type === "group" || parent.type === "row") && "fields" in parent && parent.fields) {
6939
+ const found = this.findFieldInSchema({ fields: parent.fields }, childName);
6940
+ return found ? { ...found, name } : null;
6941
+ }
6942
+ return null;
6943
+ }
6928
6944
  for (const field of fields) {
6929
6945
  if (field.name === name) {
6930
6946
  return field;