easy-forms-core 1.1.7 → 1.1.8
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/easy-form.d.ts +5 -0
- package/dist/easy-form.js +25 -2
- package/dist/easy-form.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +25 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/easy-form.d.ts
CHANGED
|
@@ -464,6 +464,11 @@ declare class EasyForm extends BrowserHTMLElement {
|
|
|
464
464
|
* Cualquier valor inválido o fuera de rango se normaliza a -1 (final del formulario).
|
|
465
465
|
*/
|
|
466
466
|
private getSlotClonesByRow;
|
|
467
|
+
/**
|
|
468
|
+
* Aplica estado disabled/loading a un clone de slot: deshabilita elementos
|
|
469
|
+
* interactivos y añade clase para estilos. Respeta el estado del formulario.
|
|
470
|
+
*/
|
|
471
|
+
private applySlotDisabledState;
|
|
467
472
|
/**
|
|
468
473
|
* Renderiza campos normales
|
|
469
474
|
*/
|
package/dist/easy-form.js
CHANGED
|
@@ -741,14 +741,20 @@ function getBaseStyles(colors) {
|
|
|
741
741
|
}
|
|
742
742
|
/* Disabled State */
|
|
743
743
|
.easy-form-disabled,
|
|
744
|
-
.easy-form-disabled
|
|
744
|
+
.easy-form-disabled *,
|
|
745
|
+
.easy-form-slot-disabled,
|
|
746
|
+
.easy-form-slot-disabled * {
|
|
745
747
|
pointer-events: none;
|
|
746
748
|
opacity: 0.6;
|
|
747
749
|
}
|
|
748
750
|
.easy-form-disabled input,
|
|
749
751
|
.easy-form-disabled textarea,
|
|
750
752
|
.easy-form-disabled select,
|
|
751
|
-
.easy-form-disabled button
|
|
753
|
+
.easy-form-disabled button,
|
|
754
|
+
.easy-form-slot-disabled input,
|
|
755
|
+
.easy-form-slot-disabled textarea,
|
|
756
|
+
.easy-form-slot-disabled select,
|
|
757
|
+
.easy-form-slot-disabled button {
|
|
752
758
|
cursor: not-allowed;
|
|
753
759
|
}
|
|
754
760
|
.easy-form-input-disabled {
|
|
@@ -5312,6 +5318,20 @@ var EasyForm = class extends BrowserHTMLElement {
|
|
|
5312
5318
|
}
|
|
5313
5319
|
return result;
|
|
5314
5320
|
}
|
|
5321
|
+
/**
|
|
5322
|
+
* Aplica estado disabled/loading a un clone de slot: deshabilita elementos
|
|
5323
|
+
* interactivos y añade clase para estilos. Respeta el estado del formulario.
|
|
5324
|
+
*/
|
|
5325
|
+
applySlotDisabledState(slotElement) {
|
|
5326
|
+
if (!this.disabled && !this.loading) return;
|
|
5327
|
+
slotElement.classList.add("easy-form-slot-disabled");
|
|
5328
|
+
const interactives = slotElement.querySelectorAll(
|
|
5329
|
+
"input, textarea, select, button"
|
|
5330
|
+
);
|
|
5331
|
+
interactives.forEach((el) => {
|
|
5332
|
+
if ("disabled" in el) el.disabled = true;
|
|
5333
|
+
});
|
|
5334
|
+
}
|
|
5315
5335
|
/**
|
|
5316
5336
|
* Renderiza campos normales
|
|
5317
5337
|
*/
|
|
@@ -5321,6 +5341,7 @@ var EasyForm = class extends BrowserHTMLElement {
|
|
|
5321
5341
|
const endSlots2 = slotClones.get(-1);
|
|
5322
5342
|
if (endSlots2 && endSlots2.length > 0) {
|
|
5323
5343
|
for (const slotElement of endSlots2) {
|
|
5344
|
+
this.applySlotDisabledState(slotElement);
|
|
5324
5345
|
container.appendChild(slotElement);
|
|
5325
5346
|
}
|
|
5326
5347
|
}
|
|
@@ -5332,6 +5353,7 @@ var EasyForm = class extends BrowserHTMLElement {
|
|
|
5332
5353
|
const slotsForRow = slotClonesByRow.get(rowIndex);
|
|
5333
5354
|
if (slotsForRow && slotsForRow.length > 0) {
|
|
5334
5355
|
for (const slotElement of slotsForRow) {
|
|
5356
|
+
this.applySlotDisabledState(slotElement);
|
|
5335
5357
|
container.appendChild(slotElement);
|
|
5336
5358
|
}
|
|
5337
5359
|
slotClonesByRow.delete(rowIndex);
|
|
@@ -5345,6 +5367,7 @@ var EasyForm = class extends BrowserHTMLElement {
|
|
|
5345
5367
|
const endSlots = slotClonesByRow.get(-1);
|
|
5346
5368
|
if (endSlots && endSlots.length > 0) {
|
|
5347
5369
|
for (const slotElement of endSlots) {
|
|
5370
|
+
this.applySlotDisabledState(slotElement);
|
|
5348
5371
|
container.appendChild(slotElement);
|
|
5349
5372
|
}
|
|
5350
5373
|
}
|