@effect-app/vue-components 0.0.8 → 0.1.0
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/types/components/OmegaForm/InputProps.d.ts +64 -0
- package/dist/types/components/OmegaForm/OmegaErrors.vue.d.ts +28 -1
- package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +1 -1
- package/dist/types/components/OmegaForm/OmegaInput.vue.d.ts +16 -6
- package/dist/types/components/OmegaForm/OmegaInputVuetify.vue.d.ts +16 -0
- package/dist/types/components/OmegaForm/OmegaInternalInput.vue.d.ts +24 -3
- package/dist/types/components/OmegaForm/index.d.ts +1 -1
- package/dist/types/index.d.ts +4 -4
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/vue-components.es.js +31 -618
- package/dist/vue-components.es10.js +25 -0
- package/dist/vue-components.es11.js +64 -0
- package/dist/vue-components.es12.js +9 -0
- package/dist/vue-components.es13.js +4 -0
- package/dist/vue-components.es14.js +90 -0
- package/dist/vue-components.es15.js +86 -0
- package/dist/vue-components.es16.js +13 -0
- package/dist/vue-components.es17.js +4 -0
- package/dist/vue-components.es18.js +134 -0
- package/dist/vue-components.es2.js +22 -0
- package/dist/vue-components.es20.js +6 -0
- package/dist/vue-components.es3.js +11 -0
- package/dist/vue-components.es4.js +30 -0
- package/dist/vue-components.es5.js +25 -0
- package/dist/vue-components.es6.js +218 -0
- package/dist/vue-components.es7.js +7 -0
- package/dist/vue-components.es8.js +48 -0
- package/dist/vue-components.es9.js +7 -0
- package/package.json +13 -4
- package/src/components/OmegaForm/InputProps.ts +81 -0
- package/src/components/OmegaForm/OmegaErrors.vue +69 -30
- package/src/components/OmegaForm/OmegaFormStuff.ts +2 -0
- package/src/components/OmegaForm/OmegaInput.vue +25 -38
- package/src/components/OmegaForm/OmegaInputVuetify.vue +164 -0
- package/src/components/OmegaForm/OmegaInternalInput.vue +43 -88
- package/src/components/OmegaForm/useOmegaForm.ts +3 -1
- package/src/components/style.css +1 -1
- package/src/constants/index.ts +1 -1
- package/src/env.d.ts +2 -2
- package/src/index.ts +12 -8
- package/src/utils/index.ts +9 -5
- package/dist/vue-components.css +0 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { FieldApi, DeepValue, ValidationError } from "@tanstack/vue-form";
|
|
2
|
+
import { type NestedKeyOf } from "./OmegaFormStuff";
|
|
3
|
+
type ValidatorFnSync = (opts: {
|
|
4
|
+
value: any;
|
|
5
|
+
fieldApi: any;
|
|
6
|
+
}) => ValidationError | undefined;
|
|
7
|
+
type ValidatorFnAsync = (opts: {
|
|
8
|
+
value: any;
|
|
9
|
+
fieldApi: any;
|
|
10
|
+
}) => Promise<ValidationError | undefined>;
|
|
11
|
+
type FormValidatorFnSync = (opts: {
|
|
12
|
+
value: any;
|
|
13
|
+
formApi: any;
|
|
14
|
+
}) => ValidationError | undefined;
|
|
15
|
+
type FormValidatorFnAsync = (opts: {
|
|
16
|
+
value: any;
|
|
17
|
+
formApi: any;
|
|
18
|
+
}) => Promise<ValidationError | undefined>;
|
|
19
|
+
type FormServerError = any;
|
|
20
|
+
type SubmitMeta = any;
|
|
21
|
+
type FlexibleUpdater<T> = ((prev: T) => T) | T;
|
|
22
|
+
export type OmegaFieldInternalApi<To> = Omit<FieldApi<To, // TParentData
|
|
23
|
+
NestedKeyOf<To>, // TName
|
|
24
|
+
DeepValue<To, NestedKeyOf<To>>, // TData
|
|
25
|
+
ValidatorFnSync, // TOnMount
|
|
26
|
+
ValidatorFnSync, // TOnChange
|
|
27
|
+
ValidatorFnAsync, // TOnChangeAsync
|
|
28
|
+
ValidatorFnSync, // TOnBlur
|
|
29
|
+
ValidatorFnAsync, // TOnBlurAsync
|
|
30
|
+
ValidatorFnSync, // TOnSubmit
|
|
31
|
+
ValidatorFnAsync, // TOnSubmitAsync
|
|
32
|
+
FormValidatorFnSync, // TFormOnMount
|
|
33
|
+
FormValidatorFnSync, // TFormOnChange
|
|
34
|
+
FormValidatorFnAsync, // TFormOnChangeAsync
|
|
35
|
+
FormValidatorFnSync, // TFormOnBlur
|
|
36
|
+
FormValidatorFnAsync, // TFormOnBlurAsync
|
|
37
|
+
FormValidatorFnSync, // TFormOnSubmit
|
|
38
|
+
FormValidatorFnAsync, // TFormOnSubmitAsync
|
|
39
|
+
FormServerError, // TFormOnServer
|
|
40
|
+
SubmitMeta>, "handleChange" | "setValue"> & {
|
|
41
|
+
handleChange: (updater: FlexibleUpdater<DeepValue<To, NestedKeyOf<To>>> | any) => void;
|
|
42
|
+
setValue: (updater: FlexibleUpdater<DeepValue<To, NestedKeyOf<To>>> | any) => void;
|
|
43
|
+
};
|
|
44
|
+
export type InputProps<T> = {
|
|
45
|
+
id: string;
|
|
46
|
+
required?: boolean;
|
|
47
|
+
minLength?: number | false;
|
|
48
|
+
maxLength?: number | false;
|
|
49
|
+
max?: number | false;
|
|
50
|
+
min?: number | false;
|
|
51
|
+
name: string;
|
|
52
|
+
modelValue: unknown;
|
|
53
|
+
errorMessages: string[];
|
|
54
|
+
error: boolean;
|
|
55
|
+
field: OmegaFieldInternalApi<T>;
|
|
56
|
+
setRealDirty: () => void;
|
|
57
|
+
type: string;
|
|
58
|
+
label: string;
|
|
59
|
+
options?: {
|
|
60
|
+
title: string;
|
|
61
|
+
value: string;
|
|
62
|
+
}[];
|
|
63
|
+
};
|
|
64
|
+
export {};
|
|
@@ -1,2 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
import { mdiLink } from "@mdi/js";
|
|
2
|
+
declare const vuetified: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any> | undefined;
|
|
3
|
+
declare const errors: import("vue").Ref<readonly import("./OmegaFormStuff").OmegaError[], readonly import("./OmegaFormStuff").OmegaError[]>, formSubmissionAttempts: import("vue").Ref<number, number>;
|
|
4
|
+
declare const trans: (id: string, values?: Record<string, import("intl-messageformat").PrimitiveType | import("intl-messageformat").FormatXMLElementFn<string, string>>) => string;
|
|
5
|
+
declare const showedGeneralErrors: import("vue").ComputedRef<string[]>;
|
|
6
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
7
|
+
declare var __VLS_5: {
|
|
8
|
+
errors: readonly import("./OmegaFormStuff").OmegaError[];
|
|
9
|
+
showedGeneralErrors: string[];
|
|
10
|
+
};
|
|
11
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
12
|
+
default?: (props: typeof __VLS_5) => any;
|
|
13
|
+
}>;
|
|
14
|
+
declare const __VLS_self: import("vue").DefineComponent<{}, {
|
|
15
|
+
mdiLink: typeof mdiLink;
|
|
16
|
+
vuetified: typeof vuetified;
|
|
17
|
+
errors: typeof errors;
|
|
18
|
+
formSubmissionAttempts: typeof formSubmissionAttempts;
|
|
19
|
+
trans: typeof trans;
|
|
20
|
+
showedGeneralErrors: typeof showedGeneralErrors;
|
|
21
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
22
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
23
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
2
24
|
export default _default;
|
|
25
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { S, type Effect } from "effect-app";
|
|
2
2
|
import { type FormAsyncValidateOrFn, type FormValidateOrFn, type StandardSchemaV1, type FormApi, type VueFormApi, type FieldComponent, type FormOptions, type DeepKeys, type FieldValidateOrFn, type FieldAsyncValidateOrFn, type FormState } from "@tanstack/vue-form";
|
|
3
3
|
import type { Component } from "vue";
|
|
4
|
-
export type TypeOverride = "string" | "text" | "number" | "select" | "multiple" | "boolean";
|
|
4
|
+
export type TypeOverride = "string" | "text" | "number" | "select" | "multiple" | "boolean" | "autocomplete" | "autocompletemultiple";
|
|
5
5
|
export interface OmegaError {
|
|
6
6
|
label: string;
|
|
7
7
|
inputId: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type FieldValidators, type FormType, type MetaRecord, type NestedKeyOf, type TypeOverride } from "./OmegaFormStuff";
|
|
2
|
-
import type {
|
|
2
|
+
import type { OmegaFieldInternalApi } from "./InputProps";
|
|
3
3
|
declare const _default: <From, To>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
4
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & {
|
|
5
5
|
form: FormType<From, To> & {
|
|
@@ -18,14 +18,24 @@ declare const _default: <From, To>(__VLS_props: NonNullable<Awaited<typeof __VLS
|
|
|
18
18
|
attrs: any;
|
|
19
19
|
slots: {
|
|
20
20
|
default?: ((props: {
|
|
21
|
-
|
|
21
|
+
id: string;
|
|
22
|
+
required?: boolean;
|
|
23
|
+
minLength?: number | false;
|
|
24
|
+
maxLength?: number | false;
|
|
25
|
+
max?: number | false;
|
|
26
|
+
min?: number | false;
|
|
27
|
+
name: string;
|
|
28
|
+
modelValue: unknown;
|
|
29
|
+
errorMessages: string[];
|
|
30
|
+
error: boolean;
|
|
31
|
+
field: OmegaFieldInternalApi<To>;
|
|
32
|
+
setRealDirty: () => void;
|
|
33
|
+
type: string;
|
|
22
34
|
label: string;
|
|
23
|
-
options
|
|
35
|
+
options?: {
|
|
24
36
|
title: string;
|
|
25
37
|
value: string;
|
|
26
|
-
}[]
|
|
27
|
-
meta: MetaRecord<To>[import("@tanstack/vue-form").DeepKeys<To>];
|
|
28
|
-
type: TypeOverride | undefined;
|
|
38
|
+
}[];
|
|
29
39
|
}) => any) | undefined;
|
|
30
40
|
};
|
|
31
41
|
emit: {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { InputProps } from "./InputProps";
|
|
2
|
+
declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & {
|
|
4
|
+
inputProps: InputProps<T>;
|
|
5
|
+
} & Partial<{}>> & import("vue").PublicProps;
|
|
6
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
7
|
+
attrs: any;
|
|
8
|
+
slots: {};
|
|
9
|
+
emit: {};
|
|
10
|
+
}>) => import("vue").VNode & {
|
|
11
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_PrettifyLocal<T> = {
|
|
15
|
+
[K in keyof T]: T[K];
|
|
16
|
+
} & {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type FieldApi } from "@tanstack/vue-form";
|
|
2
1
|
import type { FieldValidators, MetaRecord, NestedKeyOf, TypeOverride } from "./OmegaFormStuff";
|
|
2
|
+
import type { OmegaFieldInternalApi } from "./InputProps";
|
|
3
3
|
declare const _default: <To>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
4
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & {
|
|
5
|
-
field:
|
|
5
|
+
field: OmegaFieldInternalApi<To>;
|
|
6
6
|
meta: MetaRecord<To>[NestedKeyOf<To>];
|
|
7
7
|
label: string;
|
|
8
8
|
options?: {
|
|
@@ -14,7 +14,28 @@ declare const _default: <To>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup
|
|
|
14
14
|
} & Partial<{}>> & import("vue").PublicProps;
|
|
15
15
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
16
16
|
attrs: any;
|
|
17
|
-
slots: {
|
|
17
|
+
slots: {
|
|
18
|
+
default?: ((props: {
|
|
19
|
+
id: string;
|
|
20
|
+
required?: boolean;
|
|
21
|
+
minLength?: number | false;
|
|
22
|
+
maxLength?: number | false;
|
|
23
|
+
max?: number | false;
|
|
24
|
+
min?: number | false;
|
|
25
|
+
name: string;
|
|
26
|
+
modelValue: unknown;
|
|
27
|
+
errorMessages: string[];
|
|
28
|
+
error: boolean;
|
|
29
|
+
field: OmegaFieldInternalApi<To>;
|
|
30
|
+
setRealDirty: () => void;
|
|
31
|
+
type: string;
|
|
32
|
+
label: string;
|
|
33
|
+
options?: {
|
|
34
|
+
title: string;
|
|
35
|
+
value: string;
|
|
36
|
+
}[];
|
|
37
|
+
}) => any) | undefined;
|
|
38
|
+
};
|
|
18
39
|
emit: {};
|
|
19
40
|
}>) => import("vue").VNode & {
|
|
20
41
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
@@ -47,6 +47,6 @@ declare const OmegaInputCE: new <From, To>(initialProps?: Record<string, any>) =
|
|
|
47
47
|
}[] | undefined;
|
|
48
48
|
type?: import("./OmegaFormStuff").TypeOverride | undefined;
|
|
49
49
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
50
|
-
declare const OmegaErrorsCE: import("vue").VueElementConstructor<
|
|
50
|
+
declare const OmegaErrorsCE: import("vue").VueElementConstructor<unknown>;
|
|
51
51
|
export { OmegaFormCE, OmegaInputCE, OmegaErrorsCE };
|
|
52
52
|
export declare function registerOmegaForm(): void;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { App } from
|
|
1
|
+
import { type App } from "vue";
|
|
2
2
|
declare function install(app: App): void;
|
|
3
3
|
declare const _default: {
|
|
4
4
|
install: typeof install;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
7
|
+
export * from "./components";
|
|
8
|
+
export * from "./constants";
|
|
9
|
+
export * from "./utils";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { makeIntl } from "@effect-app/vue";
|
|
1
|
+
import { type makeIntl } from "@effect-app/vue";
|
|
2
2
|
export declare const useIntl: () => {
|
|
3
3
|
locale: import("vue").Ref<string, string>;
|
|
4
4
|
trans: (id: string, values?: Record<string, import("intl-messageformat").PrimitiveType | import("intl-messageformat").FormatXMLElementFn<string, string>>) => string;
|