easy-forms-core 1.2.14 → 1.2.15
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 +40 -0
- package/dist/easy-form.js +66 -40
- package/dist/easy-form.js.map +1 -1
- package/dist/index.d.ts +89 -1
- package/dist/index.js +74 -48
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -472,6 +472,8 @@ interface SubmitEventDetail {
|
|
|
472
472
|
values: Record<string, any>;
|
|
473
473
|
isValid: boolean;
|
|
474
474
|
errors: Record<string, string[]>;
|
|
475
|
+
/** Tiempo restante en segundos cuando se usa complete-time */
|
|
476
|
+
timeRemaining?: number;
|
|
475
477
|
}
|
|
476
478
|
/**
|
|
477
479
|
* Evento de change
|
|
@@ -496,6 +498,13 @@ interface StepChangeEventDetail {
|
|
|
496
498
|
previousStep: number;
|
|
497
499
|
totalSteps: number;
|
|
498
500
|
}
|
|
501
|
+
/**
|
|
502
|
+
* Evento de timeout (cuando expira el tiempo límite)
|
|
503
|
+
*/
|
|
504
|
+
interface TimeoutEventDetail {
|
|
505
|
+
originalTime: number;
|
|
506
|
+
expiredAt: Date;
|
|
507
|
+
}
|
|
499
508
|
/**
|
|
500
509
|
* Componente personalizado para inyección
|
|
501
510
|
*/
|
|
@@ -537,6 +546,10 @@ declare class EasyForm extends BrowserHTMLElement {
|
|
|
537
546
|
private persistenceDebounceTimer;
|
|
538
547
|
private pendingRestoreValues;
|
|
539
548
|
private isRestoringValues;
|
|
549
|
+
private completeTimeInterval;
|
|
550
|
+
private timeRemaining;
|
|
551
|
+
private timerStarted;
|
|
552
|
+
private timerExpired;
|
|
540
553
|
static get observedAttributes(): string[];
|
|
541
554
|
constructor();
|
|
542
555
|
/**
|
|
@@ -824,6 +837,14 @@ declare class EasyForm extends BrowserHTMLElement {
|
|
|
824
837
|
* Establece el estado de disabled
|
|
825
838
|
*/
|
|
826
839
|
set disabled(value: boolean);
|
|
840
|
+
/**
|
|
841
|
+
* Obtiene el tiempo límite en segundos
|
|
842
|
+
*/
|
|
843
|
+
get completeTime(): number | null;
|
|
844
|
+
/**
|
|
845
|
+
* Establece el tiempo límite en segundos
|
|
846
|
+
*/
|
|
847
|
+
set completeTime(value: number | null);
|
|
827
848
|
/**
|
|
828
849
|
* Configura estilos básicos
|
|
829
850
|
*/
|
|
@@ -856,6 +877,34 @@ declare class EasyForm extends BrowserHTMLElement {
|
|
|
856
877
|
* Limpia los datos de persistencia
|
|
857
878
|
*/
|
|
858
879
|
private clearPersistence;
|
|
880
|
+
/**
|
|
881
|
+
* Resetea el timer de complete-time
|
|
882
|
+
*/
|
|
883
|
+
private resetTimer;
|
|
884
|
+
/**
|
|
885
|
+
* Inicia el timer de complete-time
|
|
886
|
+
*/
|
|
887
|
+
private startTimer;
|
|
888
|
+
/**
|
|
889
|
+
* Actualiza la visualización del timer
|
|
890
|
+
*/
|
|
891
|
+
private updateTimerDisplay;
|
|
892
|
+
/**
|
|
893
|
+
* Maneja cuando el timer expira
|
|
894
|
+
*/
|
|
895
|
+
private handleTimerExpired;
|
|
896
|
+
/**
|
|
897
|
+
* Deshabilita todos los campos del formulario
|
|
898
|
+
*/
|
|
899
|
+
private disableAllFields;
|
|
900
|
+
/**
|
|
901
|
+
* Configura el event listener para iniciar el timer en el primer input
|
|
902
|
+
*/
|
|
903
|
+
private setupTimerInputListener;
|
|
904
|
+
/**
|
|
905
|
+
* Renderiza el display del timer
|
|
906
|
+
*/
|
|
907
|
+
private renderTimerDisplay;
|
|
859
908
|
}
|
|
860
909
|
|
|
861
910
|
/**
|
|
@@ -1356,4 +1405,43 @@ declare function getAvailableTemplates(): TemplateName[];
|
|
|
1356
1405
|
*/
|
|
1357
1406
|
declare function extendTemplate(templateName: string, additionalFields: Field[]): FormSchema;
|
|
1358
1407
|
|
|
1359
|
-
|
|
1408
|
+
interface EasyFormBuilderOptions {
|
|
1409
|
+
fields?: Field[];
|
|
1410
|
+
steps?: Step[];
|
|
1411
|
+
initialData?: Record<string, any>;
|
|
1412
|
+
submitButton?: SubmitButtonConfig;
|
|
1413
|
+
completedIndicator?: boolean | {
|
|
1414
|
+
position?: 'top' | 'bottom';
|
|
1415
|
+
};
|
|
1416
|
+
direction?: 'vertical' | 'horizontal';
|
|
1417
|
+
persistence?: {
|
|
1418
|
+
enabled?: boolean;
|
|
1419
|
+
key: string;
|
|
1420
|
+
autoSave?: boolean;
|
|
1421
|
+
debounce?: number;
|
|
1422
|
+
};
|
|
1423
|
+
stepStyle?: 'default' | 'tabs' | 'buttons' | 'timeline' | 'none';
|
|
1424
|
+
completeTime?: number;
|
|
1425
|
+
}
|
|
1426
|
+
declare class EasyFormBuilder {
|
|
1427
|
+
private options;
|
|
1428
|
+
constructor();
|
|
1429
|
+
fields(fields: Field[]): EasyFormBuilder;
|
|
1430
|
+
steps(steps: Step[]): EasyFormBuilder;
|
|
1431
|
+
initialData(data: Record<string, any>): EasyFormBuilder;
|
|
1432
|
+
submitButton(config: SubmitButtonConfig): EasyFormBuilder;
|
|
1433
|
+
completedIndicator(enabled?: boolean | {
|
|
1434
|
+
position?: 'top' | 'bottom';
|
|
1435
|
+
}): EasyFormBuilder;
|
|
1436
|
+
direction(direction: 'vertical' | 'horizontal'): EasyFormBuilder;
|
|
1437
|
+
persistence(key: string, options?: {
|
|
1438
|
+
autoSave?: boolean;
|
|
1439
|
+
debounce?: number;
|
|
1440
|
+
}): EasyFormBuilder;
|
|
1441
|
+
stepStyle(style: 'default' | 'tabs' | 'buttons' | 'timeline' | 'none'): EasyFormBuilder;
|
|
1442
|
+
withCompleteTime(seconds: number): EasyFormBuilder;
|
|
1443
|
+
build(): FormSchema;
|
|
1444
|
+
}
|
|
1445
|
+
declare function createFormSchema(options?: EasyFormBuilderOptions): FormSchema;
|
|
1446
|
+
|
|
1447
|
+
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, EasyFormBuilder, 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 TimeoutEventDetail, type Validation, ValidationEngine, type ValidationType, type WizardState, attributeValue, containsInjection, createFormSchema, createInput, extendTemplate, generateId, getAvailableTemplates, getColors, getCustomComponent, getNestedValue, getPredefinedMask, getTemplate, getThemeStyles, isSafeFromInjection, isValidEmail, parseAttributeValue, registerComponent, registerComponents, sanitizeId, setNestedValue, templates };
|