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/index.d.ts
CHANGED
|
@@ -513,6 +513,11 @@ declare class EasyForm extends BrowserHTMLElement {
|
|
|
513
513
|
* Cualquier valor inválido o fuera de rango se normaliza a -1 (final del formulario).
|
|
514
514
|
*/
|
|
515
515
|
private getSlotClonesByRow;
|
|
516
|
+
/**
|
|
517
|
+
* Aplica estado disabled/loading a un clone de slot: deshabilita elementos
|
|
518
|
+
* interactivos y añade clase para estilos. Respeta el estado del formulario.
|
|
519
|
+
*/
|
|
520
|
+
private applySlotDisabledState;
|
|
516
521
|
/**
|
|
517
522
|
* Renderiza campos normales
|
|
518
523
|
*/
|
package/dist/index.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 {
|
|
@@ -5321,6 +5327,20 @@ var EasyForm = class extends BrowserHTMLElement {
|
|
|
5321
5327
|
}
|
|
5322
5328
|
return result;
|
|
5323
5329
|
}
|
|
5330
|
+
/**
|
|
5331
|
+
* Aplica estado disabled/loading a un clone de slot: deshabilita elementos
|
|
5332
|
+
* interactivos y añade clase para estilos. Respeta el estado del formulario.
|
|
5333
|
+
*/
|
|
5334
|
+
applySlotDisabledState(slotElement) {
|
|
5335
|
+
if (!this.disabled && !this.loading) return;
|
|
5336
|
+
slotElement.classList.add("easy-form-slot-disabled");
|
|
5337
|
+
const interactives = slotElement.querySelectorAll(
|
|
5338
|
+
"input, textarea, select, button"
|
|
5339
|
+
);
|
|
5340
|
+
interactives.forEach((el) => {
|
|
5341
|
+
if ("disabled" in el) el.disabled = true;
|
|
5342
|
+
});
|
|
5343
|
+
}
|
|
5324
5344
|
/**
|
|
5325
5345
|
* Renderiza campos normales
|
|
5326
5346
|
*/
|
|
@@ -5330,6 +5350,7 @@ var EasyForm = class extends BrowserHTMLElement {
|
|
|
5330
5350
|
const endSlots2 = slotClones.get(-1);
|
|
5331
5351
|
if (endSlots2 && endSlots2.length > 0) {
|
|
5332
5352
|
for (const slotElement of endSlots2) {
|
|
5353
|
+
this.applySlotDisabledState(slotElement);
|
|
5333
5354
|
container.appendChild(slotElement);
|
|
5334
5355
|
}
|
|
5335
5356
|
}
|
|
@@ -5341,6 +5362,7 @@ var EasyForm = class extends BrowserHTMLElement {
|
|
|
5341
5362
|
const slotsForRow = slotClonesByRow.get(rowIndex);
|
|
5342
5363
|
if (slotsForRow && slotsForRow.length > 0) {
|
|
5343
5364
|
for (const slotElement of slotsForRow) {
|
|
5365
|
+
this.applySlotDisabledState(slotElement);
|
|
5344
5366
|
container.appendChild(slotElement);
|
|
5345
5367
|
}
|
|
5346
5368
|
slotClonesByRow.delete(rowIndex);
|
|
@@ -5354,6 +5376,7 @@ var EasyForm = class extends BrowserHTMLElement {
|
|
|
5354
5376
|
const endSlots = slotClonesByRow.get(-1);
|
|
5355
5377
|
if (endSlots && endSlots.length > 0) {
|
|
5356
5378
|
for (const slotElement of endSlots) {
|
|
5379
|
+
this.applySlotDisabledState(slotElement);
|
|
5357
5380
|
container.appendChild(slotElement);
|
|
5358
5381
|
}
|
|
5359
5382
|
}
|