easy-forms-core 1.2.12 → 1.2.14
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 +57 -0
- package/dist/easy-form.js +186 -30
- package/dist/easy-form.js.map +1 -1
- package/dist/index.d.ts +58 -1
- package/dist/index.js +186 -30
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -358,6 +358,10 @@ interface OTPField extends BaseField {
|
|
|
358
358
|
* Unión de todos los tipos de campos
|
|
359
359
|
*/
|
|
360
360
|
type Field = TextField | PasswordField | NumberField | TextareaField | SelectField | CheckboxField | RadioField | SwitchField | DateField | FileField | FileDropField | MapField | RatingField | SliderField | ColorpickerField | ArrayField | GroupField | RowField | CustomField | QuantityField | AccordionSelectField | ImageGridSelectField | OTPField;
|
|
361
|
+
/**
|
|
362
|
+
* Estilos visuales del stepper
|
|
363
|
+
*/
|
|
364
|
+
type StepStyle = 'default' | 'tabs' | 'buttons' | 'timeline' | 'none';
|
|
361
365
|
/**
|
|
362
366
|
* Step para formularios wizard
|
|
363
367
|
*/
|
|
@@ -365,6 +369,8 @@ interface Step {
|
|
|
365
369
|
title: string;
|
|
366
370
|
description?: string;
|
|
367
371
|
fields: Field[];
|
|
372
|
+
/** Estilo visual del stepper para este step */
|
|
373
|
+
stepStyle?: StepStyle;
|
|
368
374
|
}
|
|
369
375
|
/**
|
|
370
376
|
* Tipos de temas disponibles
|
|
@@ -421,6 +427,25 @@ interface FormSchema {
|
|
|
421
427
|
};
|
|
422
428
|
/** Dirección del layout: vertical (default) u horizontal */
|
|
423
429
|
direction?: 'vertical' | 'horizontal';
|
|
430
|
+
/** Configuración de persistencia/autosave del formulario */
|
|
431
|
+
persistence?: PersistenceConfig;
|
|
432
|
+
/** Estilo visual del stepper (aplica a todos los steps): 'default' | 'tabs' | 'buttons' | 'timeline' | 'none' */
|
|
433
|
+
stepStyle?: StepStyle;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Configuración de persistencia del formulario
|
|
437
|
+
*/
|
|
438
|
+
interface PersistenceConfig {
|
|
439
|
+
/** Habilitar persistencia */
|
|
440
|
+
enabled?: boolean;
|
|
441
|
+
/** Clave para localStorage */
|
|
442
|
+
key: string;
|
|
443
|
+
/** Intervalo de autosave en ms (default: 1000) */
|
|
444
|
+
autoSave?: boolean;
|
|
445
|
+
/** Debounce para guardar en ms (default: 500) */
|
|
446
|
+
debounce?: number;
|
|
447
|
+
/** Callback cuando se restauran datos */
|
|
448
|
+
onRestore?: (values: Record<string, any>) => void;
|
|
424
449
|
}
|
|
425
450
|
/**
|
|
426
451
|
* Estado del formulario
|
|
@@ -508,6 +533,10 @@ declare class EasyForm extends BrowserHTMLElement {
|
|
|
508
533
|
*/
|
|
509
534
|
private slotTemplates;
|
|
510
535
|
private skipPreserveValuesOnNextRender;
|
|
536
|
+
private persistenceConfig;
|
|
537
|
+
private persistenceDebounceTimer;
|
|
538
|
+
private pendingRestoreValues;
|
|
539
|
+
private isRestoringValues;
|
|
511
540
|
static get observedAttributes(): string[];
|
|
512
541
|
constructor();
|
|
513
542
|
/**
|
|
@@ -799,6 +828,34 @@ declare class EasyForm extends BrowserHTMLElement {
|
|
|
799
828
|
* Configura estilos básicos
|
|
800
829
|
*/
|
|
801
830
|
private setupStyles;
|
|
831
|
+
/**
|
|
832
|
+
* Inicializa la persistencia del formulario
|
|
833
|
+
*/
|
|
834
|
+
private initPersistence;
|
|
835
|
+
/**
|
|
836
|
+
* Restaura los valores desde localStorage
|
|
837
|
+
*/
|
|
838
|
+
private restoreFromStorage;
|
|
839
|
+
/**
|
|
840
|
+
* Aplica los valores pendientes de restauración después del render
|
|
841
|
+
*/
|
|
842
|
+
private applyPendingRestoreValues;
|
|
843
|
+
/**
|
|
844
|
+
* Actualiza los valores de los inputs del DOM
|
|
845
|
+
*/
|
|
846
|
+
private updateInputsWithValues;
|
|
847
|
+
/**
|
|
848
|
+
* Guarda los valores en localStorage
|
|
849
|
+
*/
|
|
850
|
+
private saveToStorage;
|
|
851
|
+
/**
|
|
852
|
+
* Programa un guardado debounced
|
|
853
|
+
*/
|
|
854
|
+
private scheduleSave;
|
|
855
|
+
/**
|
|
856
|
+
* Limpia los datos de persistencia
|
|
857
|
+
*/
|
|
858
|
+
private clearPersistence;
|
|
802
859
|
}
|
|
803
860
|
|
|
804
861
|
/**
|
|
@@ -1299,4 +1356,4 @@ declare function getAvailableTemplates(): TemplateName[];
|
|
|
1299
1356
|
*/
|
|
1300
1357
|
declare function extendTemplate(templateName: string, additionalFields: Field[]): FormSchema;
|
|
1301
1358
|
|
|
1302
|
-
export { type AccordionSelectField, type ArrayField, AttemptsLock, type AttemptsLockOptions, type BaseField, type BaseValidation, type ChangeEventDetail, type CheckboxField, type ColorpickerField, type ComponentRegistry, ConditionEngine, type ConditionOperator, type CustomComponent, type CustomField, type CustomMask, type CustomValidation, type DateField, EasyForm, type EmailValidation, type ErrorEventDetail, type Field, type FieldCondition, type FieldDependencies, type FieldType, type FileDropField, type FileField, type FormColors, type FormSchema, type FormState, type FormTheme, type GroupField, INJECTION_VALIDATION_MESSAGE, type ImageGridSelectField, type LabelPosition, type MapField, type MaskConfig, MaskEngine, type MaxLengthValidation, type MaxValidation, type MinLengthValidation, type MinValidation, type NoInjectionValidation, type NumberField, type OTPField, PREDEFINED_MASKS, type PasswordField, type PatternValidation, type PredefinedMask, type QuantityField, type RadioField, type RatingField, type RequiredValidation, type RowField, SchemaParser, type SelectField, type SliderField, type SlotContent, StateManager, type Step, type StepChangeEventDetail, type SubmitButtonConfig, type SubmitEventDetail, type SwitchField, type TemplateName, type TextField, type TextareaField, type Validation, ValidationEngine, type ValidationType, type WizardState, attributeValue, containsInjection, createInput, extendTemplate, generateId, getAvailableTemplates, getColors, getCustomComponent, getNestedValue, getPredefinedMask, getTemplate, getThemeStyles, isSafeFromInjection, isValidEmail, parseAttributeValue, registerComponent, registerComponents, sanitizeId, setNestedValue, templates };
|
|
1359
|
+
export { type AccordionSelectField, type ArrayField, AttemptsLock, type AttemptsLockOptions, type BaseField, type BaseValidation, type ChangeEventDetail, type CheckboxField, type ColorpickerField, type ComponentRegistry, ConditionEngine, type ConditionOperator, type CustomComponent, type CustomField, type CustomMask, type CustomValidation, type DateField, EasyForm, type EmailValidation, type ErrorEventDetail, type Field, type FieldCondition, type FieldDependencies, type FieldType, type FileDropField, type FileField, type FormColors, type FormSchema, type FormState, type FormTheme, type GroupField, INJECTION_VALIDATION_MESSAGE, type ImageGridSelectField, type LabelPosition, type MapField, type MaskConfig, MaskEngine, type MaxLengthValidation, type MaxValidation, type MinLengthValidation, type MinValidation, type NoInjectionValidation, type NumberField, type OTPField, PREDEFINED_MASKS, type PasswordField, type PatternValidation, type PersistenceConfig, type PredefinedMask, type QuantityField, type RadioField, type RatingField, type RequiredValidation, type RowField, SchemaParser, type SelectField, type SliderField, type SlotContent, StateManager, type Step, type StepChangeEventDetail, type StepStyle, type SubmitButtonConfig, type SubmitEventDetail, type SwitchField, type TemplateName, type TextField, type TextareaField, type Validation, ValidationEngine, type ValidationType, type WizardState, attributeValue, containsInjection, createInput, extendTemplate, generateId, getAvailableTemplates, getColors, getCustomComponent, getNestedValue, getPredefinedMask, getTemplate, getThemeStyles, isSafeFromInjection, isValidEmail, parseAttributeValue, registerComponent, registerComponents, sanitizeId, setNestedValue, templates };
|