easy-forms-core 1.0.6 → 1.0.7

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
@@ -298,6 +298,10 @@ interface FormColors {
298
298
  border?: string;
299
299
  background?: string;
300
300
  }
301
+ /**
302
+ * Template names available
303
+ */
304
+ type TemplateName = 'login' | 'register' | 'otp' | 'contact' | 'password-reset' | 'password-change' | 'profile' | 'checkout' | 'feedback' | 'subscription' | 'booking' | 'review';
301
305
  /**
302
306
  * Schema del formulario
303
307
  */
@@ -394,6 +398,22 @@ declare class EasyForm extends BrowserHTMLElement {
394
398
  * Establece el schema
395
399
  */
396
400
  set schema(value: FormSchema | null);
401
+ /**
402
+ * Obtiene el template
403
+ */
404
+ get template(): TemplateName | null;
405
+ /**
406
+ * Establece el template
407
+ */
408
+ set template(value: TemplateName | null);
409
+ /**
410
+ * Obtiene los campos adicionales para extender el template
411
+ */
412
+ get templateExtend(): Field[] | null;
413
+ /**
414
+ * Establece los campos adicionales para extender el template
415
+ */
416
+ set templateExtend(value: Field[] | null);
397
417
  /**
398
418
  * Se llama cuando el componente se conecta al DOM
399
419
  */
@@ -406,6 +426,10 @@ declare class EasyForm extends BrowserHTMLElement {
406
426
  * Maneja el cambio de schema
407
427
  */
408
428
  private handleSchemaChange;
429
+ /**
430
+ * Obtiene el schema desde un template
431
+ */
432
+ private getSchemaFromTemplate;
409
433
  /**
410
434
  * Renderiza el formulario
411
435
  */
@@ -899,4 +923,27 @@ declare function registerComponents(components: Record<string, CustomComponent>)
899
923
  */
900
924
  declare function getCustomComponent(type: string): CustomComponent | undefined;
901
925
 
902
- export { type AccordionSelectField, type ArrayField, type BaseField, type BaseValidation, type ChangeEventDetail, type CheckboxField, 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 FileField, type FormColors, type FormSchema, type FormState, type FormTheme, type GroupField, type ImageGridSelectField, type MaskConfig, MaskEngine, type MaxLengthValidation, type MaxValidation, type MinLengthValidation, type MinValidation, type NumberField, type OTPField, PREDEFINED_MASKS, type PatternValidation, type PredefinedMask, type QuantityField, type RadioField, type RequiredValidation, type RowField, SchemaParser, type SelectField, StateManager, type Step, type StepChangeEventDetail, type SubmitEventDetail, type SwitchField, type TextField, type TextareaField, type Validation, ValidationEngine, type ValidationType, type WizardState, attributeValue, createInput, generateId, getColors, getCustomComponent, getNestedValue, getPredefinedMask, getThemeStyles, isValidEmail, parseAttributeValue, registerComponent, registerComponents, sanitizeId, setNestedValue };
926
+ /**
927
+ * Registry of all available templates
928
+ */
929
+ declare const templates: Record<TemplateName, FormSchema>;
930
+ /**
931
+ * Get a template by name
932
+ * @param templateName - Name of the template to retrieve
933
+ * @returns The template schema or null if not found
934
+ */
935
+ declare function getTemplate(templateName: string): FormSchema | null;
936
+ /**
937
+ * Get list of all available template names
938
+ * @returns Array of template names
939
+ */
940
+ declare function getAvailableTemplates(): TemplateName[];
941
+ /**
942
+ * Extend a template with additional fields
943
+ * @param templateName - Name of the template to extend
944
+ * @param additionalFields - Additional fields to add to the template
945
+ * @returns Extended schema with template fields + additional fields
946
+ */
947
+ declare function extendTemplate(templateName: string, additionalFields: Field[]): FormSchema;
948
+
949
+ export { type AccordionSelectField, type ArrayField, type BaseField, type BaseValidation, type ChangeEventDetail, type CheckboxField, 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 FileField, type FormColors, type FormSchema, type FormState, type FormTheme, type GroupField, type ImageGridSelectField, type MaskConfig, MaskEngine, type MaxLengthValidation, type MaxValidation, type MinLengthValidation, type MinValidation, type NumberField, type OTPField, PREDEFINED_MASKS, type PatternValidation, type PredefinedMask, type QuantityField, type RadioField, type RequiredValidation, type RowField, SchemaParser, type SelectField, StateManager, type Step, type StepChangeEventDetail, type SubmitEventDetail, type SwitchField, type TemplateName, type TextField, type TextareaField, type Validation, ValidationEngine, type ValidationType, type WizardState, attributeValue, createInput, extendTemplate, generateId, getAvailableTemplates, getColors, getCustomComponent, getNestedValue, getPredefinedMask, getTemplate, getThemeStyles, isValidEmail, parseAttributeValue, registerComponent, registerComponents, sanitizeId, setNestedValue, templates };