easy-forms-core 1.2.13 → 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/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
@@ -423,6 +429,8 @@ interface FormSchema {
423
429
  direction?: 'vertical' | 'horizontal';
424
430
  /** Configuración de persistencia/autosave del formulario */
425
431
  persistence?: PersistenceConfig;
432
+ /** Estilo visual del stepper (aplica a todos los steps): 'default' | 'tabs' | 'buttons' | 'timeline' | 'none' */
433
+ stepStyle?: StepStyle;
426
434
  }
427
435
  /**
428
436
  * Configuración de persistencia del formulario
@@ -464,6 +472,8 @@ interface SubmitEventDetail {
464
472
  values: Record<string, any>;
465
473
  isValid: boolean;
466
474
  errors: Record<string, string[]>;
475
+ /** Tiempo restante en segundos cuando se usa complete-time */
476
+ timeRemaining?: number;
467
477
  }
468
478
  /**
469
479
  * Evento de change
@@ -488,6 +498,13 @@ interface StepChangeEventDetail {
488
498
  previousStep: number;
489
499
  totalSteps: number;
490
500
  }
501
+ /**
502
+ * Evento de timeout (cuando expira el tiempo límite)
503
+ */
504
+ interface TimeoutEventDetail {
505
+ originalTime: number;
506
+ expiredAt: Date;
507
+ }
491
508
  /**
492
509
  * Componente personalizado para inyección
493
510
  */
@@ -529,6 +546,10 @@ declare class EasyForm extends BrowserHTMLElement {
529
546
  private persistenceDebounceTimer;
530
547
  private pendingRestoreValues;
531
548
  private isRestoringValues;
549
+ private completeTimeInterval;
550
+ private timeRemaining;
551
+ private timerStarted;
552
+ private timerExpired;
532
553
  static get observedAttributes(): string[];
533
554
  constructor();
534
555
  /**
@@ -816,6 +837,14 @@ declare class EasyForm extends BrowserHTMLElement {
816
837
  * Establece el estado de disabled
817
838
  */
818
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);
819
848
  /**
820
849
  * Configura estilos básicos
821
850
  */
@@ -848,6 +877,34 @@ declare class EasyForm extends BrowserHTMLElement {
848
877
  * Limpia los datos de persistencia
849
878
  */
850
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;
851
908
  }
852
909
 
853
910
  /**
@@ -1348,4 +1405,43 @@ declare function getAvailableTemplates(): TemplateName[];
1348
1405
  */
1349
1406
  declare function extendTemplate(templateName: string, additionalFields: Field[]): FormSchema;
1350
1407
 
1351
- 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 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 };
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 };