@formatica/vue 0.1.2 → 0.2.1

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.
Files changed (95) hide show
  1. package/dist/components/BaseField.d.ts +28 -0
  2. package/dist/components/BaseField.d.ts.map +1 -0
  3. package/dist/components/FormBuilder.d.ts +25 -0
  4. package/dist/components/FormBuilder.d.ts.map +1 -0
  5. package/dist/components/FormField.d.ts +6 -0
  6. package/dist/components/FormField.d.ts.map +1 -0
  7. package/dist/components/inputs/CheckboxGroupInput.d.ts +21 -0
  8. package/dist/components/inputs/CheckboxGroupInput.d.ts.map +1 -0
  9. package/dist/components/inputs/CheckboxInput.d.ts +16 -0
  10. package/dist/components/inputs/CheckboxInput.d.ts.map +1 -0
  11. package/dist/components/inputs/DateInput.d.ts +22 -0
  12. package/dist/components/inputs/DateInput.d.ts.map +1 -0
  13. package/dist/components/inputs/FileInput.d.ts +22 -0
  14. package/dist/components/inputs/FileInput.d.ts.map +1 -0
  15. package/dist/components/inputs/NumberInput.d.ts +26 -0
  16. package/dist/components/inputs/NumberInput.d.ts.map +1 -0
  17. package/dist/components/inputs/PhoneInput.d.ts +23 -0
  18. package/dist/components/inputs/PhoneInput.d.ts.map +1 -0
  19. package/dist/components/inputs/RadioInput.d.ts +19 -0
  20. package/dist/components/inputs/RadioInput.d.ts.map +1 -0
  21. package/dist/components/inputs/SelectInput.d.ts +29 -0
  22. package/dist/components/inputs/SelectInput.d.ts.map +1 -0
  23. package/dist/components/inputs/SliderInput.d.ts +23 -0
  24. package/dist/components/inputs/SliderInput.d.ts.map +1 -0
  25. package/dist/components/inputs/SwitchInput.d.ts +17 -0
  26. package/dist/components/inputs/SwitchInput.d.ts.map +1 -0
  27. package/dist/components/inputs/TagsInput.d.ts +24 -0
  28. package/dist/components/inputs/TagsInput.d.ts.map +1 -0
  29. package/dist/components/inputs/TextInput.d.ts +27 -0
  30. package/dist/components/inputs/TextInput.d.ts.map +1 -0
  31. package/dist/components/inputs/TextareaInput.d.ts +28 -0
  32. package/dist/components/inputs/TextareaInput.d.ts.map +1 -0
  33. package/dist/components/layout/FormDivider.d.ts +7 -0
  34. package/dist/components/layout/FormDivider.d.ts.map +1 -0
  35. package/dist/components/layout/FormGroup.d.ts +15 -0
  36. package/dist/components/layout/FormGroup.d.ts.map +1 -0
  37. package/dist/components/layout/FormHtml.d.ts +7 -0
  38. package/dist/components/layout/FormHtml.d.ts.map +1 -0
  39. package/dist/components/layout/FormRow.d.ts +12 -0
  40. package/dist/components/layout/FormRow.d.ts.map +1 -0
  41. package/dist/components/layout/FormSteps.d.ts +11 -0
  42. package/dist/components/layout/FormSteps.d.ts.map +1 -0
  43. package/dist/components/layout/FormTabs.d.ts +8 -0
  44. package/dist/components/layout/FormTabs.d.ts.map +1 -0
  45. package/dist/components/layout/LayoutRenderer.d.ts +8 -0
  46. package/dist/components/layout/LayoutRenderer.d.ts.map +1 -0
  47. package/dist/core/eventBus.d.ts +9 -0
  48. package/dist/core/eventBus.d.ts.map +1 -0
  49. package/dist/core/fieldRegistry.d.ts +24 -0
  50. package/dist/core/fieldRegistry.d.ts.map +1 -0
  51. package/dist/core/ruleRegistry.d.ts +2 -0
  52. package/dist/core/ruleRegistry.d.ts.map +1 -0
  53. package/dist/core/schemaParser.d.ts +4 -0
  54. package/dist/core/schemaParser.d.ts.map +1 -0
  55. package/dist/core/useConditions.d.ts +2 -0
  56. package/dist/core/useConditions.d.ts.map +1 -0
  57. package/dist/core/useForm.d.ts +10 -0
  58. package/dist/core/useForm.d.ts.map +1 -0
  59. package/dist/core/useFormI18n.d.ts +22 -0
  60. package/dist/core/useFormI18n.d.ts.map +1 -0
  61. package/dist/core/useTheme.d.ts +28 -0
  62. package/dist/core/useTheme.d.ts.map +1 -0
  63. package/dist/core/useValidation.d.ts +17 -0
  64. package/dist/core/useValidation.d.ts.map +1 -0
  65. package/dist/formatica.es.js +974 -966
  66. package/dist/formatica.es.js.map +1 -1
  67. package/dist/formatica.umd.cjs +1 -1
  68. package/dist/formatica.umd.cjs.map +1 -1
  69. package/dist/index.d.ts +12 -0
  70. package/dist/index.d.ts.map +1 -0
  71. package/dist/plugin.d.ts +11 -0
  72. package/dist/plugin.d.ts.map +1 -0
  73. package/dist/types/form.d.ts +92 -0
  74. package/dist/types/form.d.ts.map +1 -0
  75. package/dist/types/i18n.d.ts +18 -0
  76. package/dist/types/i18n.d.ts.map +1 -0
  77. package/dist/types/index.d.ts +7 -0
  78. package/dist/types/index.d.ts.map +1 -0
  79. package/dist/types/layout.d.ts +76 -0
  80. package/dist/types/layout.d.ts.map +1 -0
  81. package/dist/types/schema.d.ts +251 -0
  82. package/dist/types/schema.d.ts.map +1 -0
  83. package/dist/types/theme.d.ts +69 -0
  84. package/dist/types/theme.d.ts.map +1 -0
  85. package/dist/types/validation.d.ts +26 -0
  86. package/dist/types/validation.d.ts.map +1 -0
  87. package/dist/utils/deepMerge.d.ts +2 -0
  88. package/dist/utils/deepMerge.d.ts.map +1 -0
  89. package/dist/utils/extractFields.d.ts +2 -0
  90. package/dist/utils/extractFields.d.ts.map +1 -0
  91. package/dist/utils/sanitize.d.ts +2 -0
  92. package/dist/utils/sanitize.d.ts.map +1 -0
  93. package/dist/utils/titleCase.d.ts +2 -0
  94. package/dist/utils/titleCase.d.ts.map +1 -0
  95. package/package.json +4 -2
@@ -0,0 +1,2 @@
1
+ export { getRule, hasRule, registerRule, unregisterRule } from '@formatica/core';
2
+ //# sourceMappingURL=ruleRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ruleRegistry.d.ts","sourceRoot":"","sources":["../../src/core/ruleRegistry.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { SchemaValidationError, parseFormSchema as coreParseFormSchema } from '@formatica/core';
2
+ export { SchemaValidationError };
3
+ export declare const parseFormSchema: typeof coreParseFormSchema;
4
+ //# sourceMappingURL=schemaParser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemaParser.d.ts","sourceRoot":"","sources":["../../src/core/schemaParser.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,qBAAqB,EACrB,eAAe,IAAI,mBAAmB,EAEzC,MAAM,iBAAiB,CAAC;AAOzB,OAAO,EAAE,qBAAqB,EAAE,CAAC;AACjC,eAAO,MAAM,eAAe,4BAAsB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { evaluateCondition } from '@formatica/core';
2
+ //# sourceMappingURL=useConditions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useConditions.d.ts","sourceRoot":"","sources":["../../src/core/useConditions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { InjectionKey } from 'vue';
2
+ import { FormSchema } from '@formatica/core';
3
+ import { FormInstance } from '../types/form';
4
+ export declare const FormContextKey: InjectionKey<FormInstance>;
5
+ export interface UseFormOptions {
6
+ locale?: string;
7
+ fallbackLocale?: string;
8
+ }
9
+ export declare function useForm(schema: FormSchema, options?: UseFormOptions): FormInstance;
10
+ //# sourceMappingURL=useForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../src/core/useForm.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,KAAK,YAAY,EAAiC,MAAM,KAAK,CAAC;AACjF,OAAO,KAAK,EAAkC,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElF,OAAO,KAAK,EAA8B,YAAY,EAAiB,MAAM,eAAe,CAAC;AAS7F,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,YAAY,CAA8B,CAAC;AAMrF,MAAM,WAAW,cAAc;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AA8CD,wBAAgB,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,YAAY,CAoQlF"}
@@ -0,0 +1,22 @@
1
+ import { InjectionKey, Ref } from 'vue';
2
+ import { FieldTranslations, FormTranslations } from '@formatica/core';
3
+ export declare const FormI18nKey: InjectionKey<FormI18nInstance>;
4
+ export interface FormI18nInstance {
5
+ locale: Ref<string>;
6
+ fallbackLocale: string;
7
+ t: (field: string, key: string) => string;
8
+ tOption: (field: string, optionValue: string) => string;
9
+ tValidation: (ruleName: string, params?: Record<string, unknown>) => string;
10
+ }
11
+ export interface UseFormI18nOptions {
12
+ locale: Ref<string>;
13
+ fallbackLocale?: string;
14
+ fieldTranslations?: Record<string, FieldTranslations>;
15
+ formTranslations?: FormTranslations;
16
+ }
17
+ export declare function useFormI18n(options: UseFormI18nOptions): FormI18nInstance;
18
+ /**
19
+ * Inject the i18n instance provided by a parent useFormI18n call.
20
+ */
21
+ export declare function useFormI18nContext(): FormI18nInstance | undefined;
22
+ //# sourceMappingURL=useFormI18n.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFormI18n.d.ts","sourceRoot":"","sources":["../../src/core/useFormI18n.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAmB,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAO3E,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,gBAAgB,CAA2B,CAAC;AAMnF,MAAM,WAAW,gBAAgB;IAC7B,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IAC1C,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC;IACxD,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC;CAC/E;AAED,MAAM,WAAW,kBAAkB;IAC/B,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACtD,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACvC;AA4BD,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,gBAAgB,CAiFzE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,gBAAgB,GAAG,SAAS,CAEjE"}
@@ -0,0 +1,28 @@
1
+ import { ComputedRef, Ref, InjectionKey } from 'vue';
2
+ import { ThemeConfig } from '@formatica/core';
3
+ export declare const FormThemeKey: InjectionKey<ThemeInstance>;
4
+ export interface ThemeClasses {
5
+ form: string;
6
+ field: string;
7
+ label: string;
8
+ input: string;
9
+ error: string;
10
+ helpText: string;
11
+ group: string;
12
+ row: string;
13
+ steps: string;
14
+ tabs: string;
15
+ button: string;
16
+ }
17
+ export interface ThemeInstance {
18
+ config: ThemeConfig;
19
+ classes: ComputedRef<ThemeClasses>;
20
+ cssVars: ComputedRef<Record<string, string>>;
21
+ }
22
+ export declare function useTheme(config?: ThemeConfig | Ref<ThemeConfig | undefined>): ThemeInstance;
23
+ /**
24
+ * Inject the theme instance provided by a parent useTheme call.
25
+ * Falls back to default theme classes if no provider exists.
26
+ */
27
+ export declare function useThemeClasses(): ThemeInstance;
28
+ //# sourceMappingURL=useTheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/core/useTheme.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,WAAW,EAChB,KAAK,GAAG,EAER,KAAK,YAAY,EAMpB,MAAM,KAAK,CAAC;AACb,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAMnD,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,aAAa,CAA4B,CAAC;AAMlF,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IACnC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAChD;AA+DD,wBAAgB,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,GAAG,aAAa,CAwE3F;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,aAAa,CAK/C"}
@@ -0,0 +1,17 @@
1
+ import { Ref } from 'vue';
2
+ import { FieldSchema, FormSettings } from '@formatica/core';
3
+ import { FormContext } from '../types/form';
4
+ export interface UseValidationOptions {
5
+ fields: Ref<FieldSchema[]>;
6
+ values: Ref<Record<string, unknown>>;
7
+ settings?: FormSettings;
8
+ }
9
+ export interface UseValidationReturn {
10
+ errors: Ref<Record<string, string[]>>;
11
+ validateField: (name: string, ctx: FormContext) => Promise<string[]>;
12
+ validateAll: (ctx: FormContext) => Promise<Record<string, string[]>>;
13
+ clearFieldErrors: (name: string) => void;
14
+ clearAllErrors: () => void;
15
+ }
16
+ export declare function useValidation(options: UseValidationOptions): UseValidationReturn;
17
+ //# sourceMappingURL=useValidation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useValidation.d.ts","sourceRoot":"","sources":["../../src/core/useValidation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,GAAG,EAAO,MAAM,KAAK,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAkB,MAAM,iBAAiB,CAAC;AAEjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AA4FjD,MAAM,WAAW,oBAAoB;IACjC,MAAM,EAAE,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;IAC3B,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,YAAY,CAAC;CAC3B;AAED,MAAM,WAAW,mBAAmB;IAChC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IACtC,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACrE,WAAW,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IACrE,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,cAAc,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,mBAAmB,CA4GhF"}