@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.
- package/dist/components/BaseField.d.ts +28 -0
- package/dist/components/BaseField.d.ts.map +1 -0
- package/dist/components/FormBuilder.d.ts +25 -0
- package/dist/components/FormBuilder.d.ts.map +1 -0
- package/dist/components/FormField.d.ts +6 -0
- package/dist/components/FormField.d.ts.map +1 -0
- package/dist/components/inputs/CheckboxGroupInput.d.ts +21 -0
- package/dist/components/inputs/CheckboxGroupInput.d.ts.map +1 -0
- package/dist/components/inputs/CheckboxInput.d.ts +16 -0
- package/dist/components/inputs/CheckboxInput.d.ts.map +1 -0
- package/dist/components/inputs/DateInput.d.ts +22 -0
- package/dist/components/inputs/DateInput.d.ts.map +1 -0
- package/dist/components/inputs/FileInput.d.ts +22 -0
- package/dist/components/inputs/FileInput.d.ts.map +1 -0
- package/dist/components/inputs/NumberInput.d.ts +26 -0
- package/dist/components/inputs/NumberInput.d.ts.map +1 -0
- package/dist/components/inputs/PhoneInput.d.ts +23 -0
- package/dist/components/inputs/PhoneInput.d.ts.map +1 -0
- package/dist/components/inputs/RadioInput.d.ts +19 -0
- package/dist/components/inputs/RadioInput.d.ts.map +1 -0
- package/dist/components/inputs/SelectInput.d.ts +29 -0
- package/dist/components/inputs/SelectInput.d.ts.map +1 -0
- package/dist/components/inputs/SliderInput.d.ts +23 -0
- package/dist/components/inputs/SliderInput.d.ts.map +1 -0
- package/dist/components/inputs/SwitchInput.d.ts +17 -0
- package/dist/components/inputs/SwitchInput.d.ts.map +1 -0
- package/dist/components/inputs/TagsInput.d.ts +24 -0
- package/dist/components/inputs/TagsInput.d.ts.map +1 -0
- package/dist/components/inputs/TextInput.d.ts +27 -0
- package/dist/components/inputs/TextInput.d.ts.map +1 -0
- package/dist/components/inputs/TextareaInput.d.ts +28 -0
- package/dist/components/inputs/TextareaInput.d.ts.map +1 -0
- package/dist/components/layout/FormDivider.d.ts +7 -0
- package/dist/components/layout/FormDivider.d.ts.map +1 -0
- package/dist/components/layout/FormGroup.d.ts +15 -0
- package/dist/components/layout/FormGroup.d.ts.map +1 -0
- package/dist/components/layout/FormHtml.d.ts +7 -0
- package/dist/components/layout/FormHtml.d.ts.map +1 -0
- package/dist/components/layout/FormRow.d.ts +12 -0
- package/dist/components/layout/FormRow.d.ts.map +1 -0
- package/dist/components/layout/FormSteps.d.ts +11 -0
- package/dist/components/layout/FormSteps.d.ts.map +1 -0
- package/dist/components/layout/FormTabs.d.ts +8 -0
- package/dist/components/layout/FormTabs.d.ts.map +1 -0
- package/dist/components/layout/LayoutRenderer.d.ts +8 -0
- package/dist/components/layout/LayoutRenderer.d.ts.map +1 -0
- package/dist/core/eventBus.d.ts +9 -0
- package/dist/core/eventBus.d.ts.map +1 -0
- package/dist/core/fieldRegistry.d.ts +24 -0
- package/dist/core/fieldRegistry.d.ts.map +1 -0
- package/dist/core/ruleRegistry.d.ts +2 -0
- package/dist/core/ruleRegistry.d.ts.map +1 -0
- package/dist/core/schemaParser.d.ts +4 -0
- package/dist/core/schemaParser.d.ts.map +1 -0
- package/dist/core/useConditions.d.ts +2 -0
- package/dist/core/useConditions.d.ts.map +1 -0
- package/dist/core/useForm.d.ts +10 -0
- package/dist/core/useForm.d.ts.map +1 -0
- package/dist/core/useFormI18n.d.ts +22 -0
- package/dist/core/useFormI18n.d.ts.map +1 -0
- package/dist/core/useTheme.d.ts +28 -0
- package/dist/core/useTheme.d.ts.map +1 -0
- package/dist/core/useValidation.d.ts +17 -0
- package/dist/core/useValidation.d.ts.map +1 -0
- package/dist/formatica.es.js +974 -966
- package/dist/formatica.es.js.map +1 -1
- package/dist/formatica.umd.cjs +1 -1
- package/dist/formatica.umd.cjs.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/plugin.d.ts +11 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/types/form.d.ts +92 -0
- package/dist/types/form.d.ts.map +1 -0
- package/dist/types/i18n.d.ts +18 -0
- package/dist/types/i18n.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/layout.d.ts +76 -0
- package/dist/types/layout.d.ts.map +1 -0
- package/dist/types/schema.d.ts +251 -0
- package/dist/types/schema.d.ts.map +1 -0
- package/dist/types/theme.d.ts +69 -0
- package/dist/types/theme.d.ts.map +1 -0
- package/dist/types/validation.d.ts +26 -0
- package/dist/types/validation.d.ts.map +1 -0
- package/dist/utils/deepMerge.d.ts +2 -0
- package/dist/utils/deepMerge.d.ts.map +1 -0
- package/dist/utils/extractFields.d.ts +2 -0
- package/dist/utils/extractFields.d.ts.map +1 -0
- package/dist/utils/sanitize.d.ts +2 -0
- package/dist/utils/sanitize.d.ts.map +1 -0
- package/dist/utils/titleCase.d.ts +2 -0
- package/dist/utils/titleCase.d.ts.map +1 -0
- package/package.json +4 -2
|
@@ -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 @@
|
|
|
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 @@
|
|
|
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"}
|