@effect-app/vue-components 1.0.0-next.0 → 1.0.0-next.10
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/OmegaAutoGen.vue.d.ts +1 -2
- package/dist/types/components/OmegaForm/OmegaFormInput.vue.d.ts +3 -10
- package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +23 -9
- package/dist/types/components/OmegaForm/OmegaInput.vue.d.ts +2 -2
- package/dist/types/components/OmegaForm/OmegaWrapper.vue.d.ts +2 -2
- package/dist/types/components/OmegaForm/index.d.ts +1 -0
- package/dist/types/components/OmegaForm/useOmegaForm.d.ts +39 -41
- package/dist/vue-components.es.js +7 -6
- package/dist/vue-components.es14.js +2 -2
- package/dist/vue-components.es15.js +1 -1
- package/dist/vue-components.es16.js +1 -1
- package/dist/vue-components.es17.js +18 -19
- package/dist/vue-components.es2.js +4 -3
- package/dist/vue-components.es24.js +1 -1
- package/dist/vue-components.es27.js +135 -11
- package/dist/vue-components.es29.js +11 -5
- package/dist/vue-components.es30.js +20 -18
- package/dist/vue-components.es31.js +5 -30
- package/dist/vue-components.es32.js +16 -17
- package/dist/vue-components.es33.js +25 -7
- package/dist/vue-components.es34.js +22 -5
- package/dist/vue-components.es35.js +12 -19
- package/dist/vue-components.es36.js +5 -9
- package/dist/vue-components.es37.js +19 -31
- package/dist/vue-components.es38.js +9 -48
- package/dist/vue-components.es39.js +25 -20
- package/dist/vue-components.es4.js +1 -1
- package/dist/vue-components.es40.js +47 -114
- package/dist/vue-components.es41.js +28 -0
- package/dist/vue-components.es42.js +65 -4
- package/dist/vue-components.es43.js +45 -54
- package/dist/vue-components.es44.js +15 -54
- package/dist/vue-components.es45.js +31 -15
- package/dist/vue-components.es46.js +26 -30
- package/dist/vue-components.es47.js +42 -29
- package/dist/vue-components.es48.js +4 -42
- package/dist/vue-components.es6.js +58 -61
- package/dist/vue-components.es7.js +28 -11
- package/package.json +1 -1
- package/src/components/OmegaForm/OmegaAutoGen.vue +1 -5
- package/src/components/OmegaForm/OmegaFormInput.vue +6 -8
- package/src/components/OmegaForm/OmegaFormStuff.ts +56 -8
- package/src/components/OmegaForm/OmegaInput.vue +2 -2
- package/src/components/OmegaForm/OmegaInputVuetify.vue +21 -2
- package/src/components/OmegaForm/OmegaInternalInput.vue +1 -2
- package/src/components/OmegaForm/OmegaWrapper.vue +2 -2
- package/src/components/OmegaForm/index.ts +2 -0
- package/src/components/OmegaForm/useOmegaForm.ts +72 -49
- package/dist/vue-components.es28.js +0 -25
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type DeepKeys } from "@tanstack/vue-form";
|
|
2
2
|
import { Order } from "effect-app";
|
|
3
|
-
import { type OmegaInputProps } from "./OmegaFormStuff";
|
|
4
|
-
export type OmegaAutoGenMeta<From extends Record<PropertyKey, string>, To extends Record<PropertyKey, string>> = Omit<OmegaInputProps<From, To>, "form">;
|
|
3
|
+
import { type OmegaAutoGenMeta, type OmegaInputProps } from "./OmegaFormStuff";
|
|
5
4
|
declare const _default: <From extends Record<PropertyKey, string>, To extends Record<PropertyKey, string>>(__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<{
|
|
6
5
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & {
|
|
7
6
|
form: OmegaInputProps<From, To>["form"];
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import { type DeepKeys } from "@tanstack/vue-form";
|
|
2
2
|
import type { InputProps } from "./InputProps";
|
|
3
|
-
import type {
|
|
3
|
+
import type { DefaultInputProps } from "./OmegaFormStuff";
|
|
4
4
|
declare const _default: <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, Name extends DeepKeys<From>>(__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<{
|
|
5
|
-
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & {
|
|
5
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & ({
|
|
6
6
|
name: Name;
|
|
7
|
-
|
|
8
|
-
validators?: FieldValidators<From>;
|
|
9
|
-
options?: {
|
|
10
|
-
title: string;
|
|
11
|
-
value: string;
|
|
12
|
-
}[];
|
|
13
|
-
type?: TypeOverride;
|
|
14
|
-
} & {}> & import("vue").PublicProps;
|
|
7
|
+
} & DefaultInputProps<From>) & {}> & import("vue").PublicProps;
|
|
15
8
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
16
9
|
attrs: any;
|
|
17
10
|
slots: {
|
|
@@ -2,23 +2,32 @@ import { type Effect, S } from "effect-app";
|
|
|
2
2
|
import { type DeepKeys, type FieldAsyncValidateOrFn, type FieldValidateOrFn, type FormApi, type FormAsyncValidateOrFn, type FormOptions, type FormState, type FormValidateOrFn, type StandardSchemaV1, type VueFormApi } from "@tanstack/vue-form";
|
|
3
3
|
import { type RuntimeFiber } from "effect/Fiber";
|
|
4
4
|
import { type OmegaFieldInternalApi } from "./InputProps";
|
|
5
|
-
import { type OmegaFormReturn } from "./useOmegaForm";
|
|
5
|
+
import { type OF, type OmegaFormReturn } from "./useOmegaForm";
|
|
6
6
|
export type ShowErrorsOn = "onChange" | "onBlur" | "onSubmit";
|
|
7
|
-
export type
|
|
8
|
-
form: OmegaFormReturn<From, To> & {
|
|
9
|
-
meta: MetaRecord<From>;
|
|
10
|
-
i18nNamespace?: string;
|
|
11
|
-
};
|
|
12
|
-
name: NestedKeyOf<From>;
|
|
13
|
-
validators?: FieldValidators<From>;
|
|
7
|
+
export type DefaultInputProps<From> = {
|
|
14
8
|
label?: string;
|
|
9
|
+
validators?: FieldValidators<From>;
|
|
15
10
|
options?: {
|
|
16
11
|
title: string;
|
|
17
12
|
value: string;
|
|
18
13
|
}[];
|
|
19
14
|
type?: TypeOverride;
|
|
20
15
|
};
|
|
21
|
-
export type
|
|
16
|
+
export type OmegaInputPropsBase<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>> = {
|
|
17
|
+
form: OF<From, To> & {
|
|
18
|
+
meta: MetaRecord<From>;
|
|
19
|
+
i18nNamespace?: string;
|
|
20
|
+
};
|
|
21
|
+
name: NestedKeyOf<From>;
|
|
22
|
+
} & DefaultInputProps<From>;
|
|
23
|
+
export type OmegaInputProps<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, InputProps = DefaultInputProps<From>> = {
|
|
24
|
+
form: OmegaFormReturn<From, To, InputProps> & {
|
|
25
|
+
meta: MetaRecord<From>;
|
|
26
|
+
i18nNamespace?: string;
|
|
27
|
+
};
|
|
28
|
+
name: NestedKeyOf<From>;
|
|
29
|
+
} & DefaultInputProps<From>;
|
|
30
|
+
export type TypeOverride = "string" | "text" | "number" | "select" | "multiple" | "boolean" | "radio" | "autocomplete" | "autocompletemultiple" | "switch" | "range" | "password" | "email";
|
|
22
31
|
export interface OmegaError {
|
|
23
32
|
label: string;
|
|
24
33
|
inputId: string;
|
|
@@ -111,3 +120,8 @@ export declare const generateInputStandardSchemaFromFieldMeta: (meta: FieldMeta)
|
|
|
111
120
|
export declare const nullableInput: <A, I, R>(schema: S.Schema<A, I, R>, defaultValue: () => A) => S.transform<import("effect/Schema").NullOr<S.Schema<A, I, R>> & {
|
|
112
121
|
withDefault: S.PropertySignature<":", A | null, never, ":", I | null, true, R>;
|
|
113
122
|
}, S.SchemaClass<A, A, never>>;
|
|
123
|
+
export type OmegaAutoGenMeta<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>> = Omit<OmegaInputProps<From, To>, "form">;
|
|
124
|
+
declare const supportedInputs: readonly ["button", "checkbox", "color", "date", "email", "number", "password", "radio", "range", "search", "submit", "tel", "text", "time", "url"];
|
|
125
|
+
export type SupportedInputs = typeof supportedInputs[number];
|
|
126
|
+
export declare const getInputType: (input: string) => SupportedInputs;
|
|
127
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type OmegaInputPropsBase } from "./OmegaFormStuff";
|
|
2
2
|
declare const _default: <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>>(__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> &
|
|
3
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & OmegaInputPropsBase<From, To> & {}> & import("vue").PublicProps;
|
|
4
4
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
5
5
|
attrs: any;
|
|
6
6
|
slots: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type OmegaFormState } from "./OmegaFormStuff";
|
|
2
|
-
import { type
|
|
1
|
+
import { type DefaultInputProps, type OmegaFormState } from "./OmegaFormStuff";
|
|
2
|
+
import { type OmegaFormReturn } from "./useOmegaForm";
|
|
3
3
|
declare const _default: <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, K extends keyof OmegaFormState<From, To> = keyof OmegaFormState<From, To>, Props = DefaultInputProps<From>>(__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: OmegaFormReturn<From, To, Props>;
|
|
@@ -2,4 +2,5 @@ import { default as OmegaInput } from "./OmegaInput.vue";
|
|
|
2
2
|
export * as OmegaErrorsContext from "./OmegaErrorsContext";
|
|
3
3
|
export * from "./OmegaFormStuff";
|
|
4
4
|
export { type OmegaFormReturn, useOmegaForm } from "./useOmegaForm";
|
|
5
|
+
export { getInputType } from "./OmegaFormStuff";
|
|
5
6
|
export { OmegaInput };
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { type DeepKeys } from "@tanstack/vue-form";
|
|
2
|
-
import { S } from "effect-app";
|
|
2
|
+
import { Order, S } from "effect-app";
|
|
3
3
|
import { type InjectionKey } from "vue";
|
|
4
|
-
import { getOmegaStore } from "./getOmegaStore";
|
|
5
4
|
import { type InputProps } from "./InputProps";
|
|
6
|
-
import
|
|
7
|
-
import OmegaAutoGen from "./OmegaAutoGen.vue";
|
|
8
|
-
import OmegaErrorsInternal from "./OmegaErrorsInternal.vue";
|
|
9
|
-
import { type FieldValidators, type FilterItems, type FormProps, type MetaRecord, type NestedKeyOf, type OmegaFormApi, OmegaFormState, ShowErrorsOn, type TypeOverride } from "./OmegaFormStuff";
|
|
10
|
-
import OmegaForm from "./OmegaWrapper.vue";
|
|
5
|
+
import { DefaultInputProps, type FilterItems, type FormProps, type MetaRecord, type NestedKeyOf, OmegaAutoGenMeta, OmegaError, type OmegaFormApi, OmegaFormState, ShowErrorsOn } from "./OmegaFormStuff";
|
|
11
6
|
type keysRule<T> = {
|
|
12
7
|
keys?: NestedKeyOf<T>[];
|
|
13
8
|
banKeys?: "You should only use one of banKeys or keys, not both, moron";
|
|
@@ -27,9 +22,9 @@ export type OmegaConfig<T> = {
|
|
|
27
22
|
overrideDefaultValues?: boolean;
|
|
28
23
|
id?: string;
|
|
29
24
|
} & keysRule<T>;
|
|
30
|
-
input?:
|
|
25
|
+
input?: any;
|
|
31
26
|
};
|
|
32
|
-
interface OF<From, To> extends OmegaFormApi<From, To> {
|
|
27
|
+
export interface OF<From, To> extends OmegaFormApi<From, To> {
|
|
33
28
|
meta: MetaRecord<From>;
|
|
34
29
|
filterItems?: FilterItems;
|
|
35
30
|
clear: () => void;
|
|
@@ -39,15 +34,6 @@ export declare const OmegaFormKey: InjectionKey<OF<any, any>>;
|
|
|
39
34
|
type __VLS_PrettifyLocal<T> = {
|
|
40
35
|
[K in keyof T]: T[K];
|
|
41
36
|
} & {};
|
|
42
|
-
export type DefaultInputProps<From> = {
|
|
43
|
-
label?: string;
|
|
44
|
-
validators?: FieldValidators<From>;
|
|
45
|
-
options?: {
|
|
46
|
-
title: string;
|
|
47
|
-
value: string;
|
|
48
|
-
}[];
|
|
49
|
-
type?: TypeOverride;
|
|
50
|
-
};
|
|
51
37
|
export interface OmegaFormReturn<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, Props = DefaultInputProps<From>> extends OF<From, To> {
|
|
52
38
|
Input: <Name extends DeepKeys<From>>(__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<{
|
|
53
39
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & {
|
|
@@ -63,35 +49,33 @@ export interface OmegaFormReturn<From extends Record<PropertyKey, any>, To exten
|
|
|
63
49
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
64
50
|
};
|
|
65
51
|
Errors: (__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<{
|
|
66
|
-
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> &
|
|
52
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & Partial<{}>> & import("vue").PublicProps;
|
|
67
53
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
68
54
|
attrs: any;
|
|
69
|
-
slots: {
|
|
55
|
+
slots: {
|
|
56
|
+
default: (props: {
|
|
57
|
+
errors: readonly OmegaError[];
|
|
58
|
+
showedGeneralErrors: string[];
|
|
59
|
+
}) => void;
|
|
60
|
+
};
|
|
70
61
|
emit: {};
|
|
71
62
|
}>) => import("vue").VNode & {
|
|
72
63
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
73
64
|
};
|
|
74
65
|
Array: (__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<{
|
|
75
|
-
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> &
|
|
66
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & {
|
|
67
|
+
pick?: DeepKeys<From>[];
|
|
68
|
+
omit?: DeepKeys<From>[];
|
|
69
|
+
labelMap?: (key: DeepKeys<From>) => string | undefined;
|
|
70
|
+
filterMap?: <M extends OmegaAutoGenMeta<From, To>>(key: DeepKeys<From>, meta: M) => boolean | M;
|
|
71
|
+
order?: DeepKeys<From>[];
|
|
72
|
+
sort?: Order.Order<OmegaAutoGenMeta<From, To>>;
|
|
73
|
+
} & {}> & import("vue").PublicProps;
|
|
76
74
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
77
75
|
attrs: any;
|
|
78
76
|
slots: {
|
|
79
77
|
default(props: {
|
|
80
|
-
|
|
81
|
-
subState: any;
|
|
82
|
-
index: number;
|
|
83
|
-
field: any;
|
|
84
|
-
}): void;
|
|
85
|
-
preArray(props: {
|
|
86
|
-
field: any;
|
|
87
|
-
state: any;
|
|
88
|
-
}): void;
|
|
89
|
-
postArray(props: {
|
|
90
|
-
field: any;
|
|
91
|
-
state: any;
|
|
92
|
-
}): void;
|
|
93
|
-
field(props: {
|
|
94
|
-
field: any;
|
|
78
|
+
child: OmegaAutoGenMeta<From, To>;
|
|
95
79
|
}): void;
|
|
96
80
|
};
|
|
97
81
|
emit: {};
|
|
@@ -99,21 +83,35 @@ export interface OmegaFormReturn<From extends Record<PropertyKey, any>, To exten
|
|
|
99
83
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
100
84
|
};
|
|
101
85
|
AutoGen: (__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<{
|
|
102
|
-
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> &
|
|
86
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & {
|
|
87
|
+
pick?: DeepKeys<From>[];
|
|
88
|
+
omit?: DeepKeys<From>[];
|
|
89
|
+
labelMap?: (key: DeepKeys<From>) => string | undefined;
|
|
90
|
+
filterMap?: <M extends OmegaAutoGenMeta<From, To>>(key: DeepKeys<From>, meta: M) => boolean | M;
|
|
91
|
+
order?: DeepKeys<From>[];
|
|
92
|
+
sort?: Order.Order<OmegaAutoGenMeta<From, To>>;
|
|
93
|
+
} & {}> & import("vue").PublicProps;
|
|
103
94
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
104
95
|
attrs: any;
|
|
105
|
-
slots: {
|
|
96
|
+
slots: {
|
|
97
|
+
default(props: {
|
|
98
|
+
child: OmegaAutoGenMeta<From, To>;
|
|
99
|
+
}): void;
|
|
100
|
+
};
|
|
106
101
|
emit: {};
|
|
107
102
|
}>) => import("vue").VNode & {
|
|
108
103
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
109
104
|
};
|
|
110
|
-
Form: <K extends keyof OmegaFormState<To, From
|
|
111
|
-
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> &
|
|
105
|
+
Form: <K extends keyof OmegaFormState<To, From>>(__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<{
|
|
106
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & {
|
|
107
|
+
disabled?: boolean;
|
|
108
|
+
subscribe?: K[];
|
|
109
|
+
} & {}> & import("vue").PublicProps;
|
|
112
110
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
113
111
|
attrs: any;
|
|
114
112
|
slots: {
|
|
115
113
|
default(props: {
|
|
116
|
-
subscribedValues:
|
|
114
|
+
subscribedValues: K[] extends undefined[] ? Record<string, never> : Pick<OmegaFormState<From, To>, K>;
|
|
117
115
|
}): void;
|
|
118
116
|
};
|
|
119
117
|
emit: {};
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import * as o from "./vue-components.es2.js";
|
|
2
2
|
import { getTransformationFrom as f, provideIntl as l, useIntl as s, useIntlKey as i } from "./vue-components.es3.js";
|
|
3
3
|
import { default as d } from "./vue-components.es4.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as a from "./vue-components.es5.js";
|
|
5
5
|
import { useOmegaForm as g } from "./vue-components.es6.js";
|
|
6
|
-
import { createMeta as y, duplicateSchema as F, generateInputStandardSchemaFromFieldMeta as O, generateMetaFromSchema as h,
|
|
7
|
-
function
|
|
6
|
+
import { createMeta as y, duplicateSchema as F, generateInputStandardSchemaFromFieldMeta as O, generateMetaFromSchema as h, getInputType as S, nullableInput as b } from "./vue-components.es7.js";
|
|
7
|
+
function n(r) {
|
|
8
8
|
for (const e in o)
|
|
9
9
|
if (Object.prototype.hasOwnProperty.call(o, e)) {
|
|
10
10
|
const t = o[e];
|
|
11
11
|
t && typeof t == "object" && r.component(e, t);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
const m = { install:
|
|
14
|
+
const m = { install: n };
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
a as OmegaErrorsContext,
|
|
17
17
|
d as OmegaInput,
|
|
18
18
|
y as createMeta,
|
|
19
19
|
m as default,
|
|
20
20
|
F as duplicateSchema,
|
|
21
21
|
O as generateInputStandardSchemaFromFieldMeta,
|
|
22
22
|
h as generateMetaFromSchema,
|
|
23
|
+
S as getInputType,
|
|
23
24
|
f as getTransformationFrom,
|
|
24
|
-
|
|
25
|
+
b as nullableInput,
|
|
25
26
|
l as provideIntl,
|
|
26
27
|
s as useIntl,
|
|
27
28
|
i as useIntlKey,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var n=document.createElement("style");if(n.appendChild(document.createTextNode("fieldset[data-v-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var n=document.createElement("style");if(n.appendChild(document.createTextNode("fieldset[data-v-440e1a59]{display:contents}fieldset[disabled][data-v-440e1a59]>*{pointer-events:none}")),document.head.appendChild(n),window.customElements){const e=window.customElements.define;window.customElements.define=function(i,t){const d=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(d&&d.call(this),this.shadowRoot){const o=document.createElement("style");o.appendChild(document.createTextNode("fieldset[data-v-440e1a59]{display:contents}fieldset[disabled][data-v-440e1a59]>*{pointer-events:none}")),this.shadowRoot.appendChild(o)}},e.call(window.customElements,i,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
2
|
import o from "./vue-components.es24.js";
|
|
3
3
|
|
|
4
4
|
import m from "./vue-components.es23.js";
|
|
5
|
-
const e = /* @__PURE__ */ m(o, [["__scopeId", "data-v-
|
|
5
|
+
const e = /* @__PURE__ */ m(o, [["__scopeId", "data-v-440e1a59"]]);
|
|
6
6
|
export {
|
|
7
7
|
e as default
|
|
8
8
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var i=document.createElement("style");if(i.appendChild(document.createTextNode(".omega-input .v-input__details:has(.v-messages:empty){grid-template-rows:0fr;transition:all .2s}.omega-input .v-messages:empty{min-height:0}.omega-input .v-input__details:has(.v-messages){transition:all .2s;overflow:hidden;min-height:0;display:grid;grid-template-rows:1fr}.omega-input .v-messages{transition:all .2s}.omega-input .v-messages>*{transition-duration:0s!important}.omega-input [role=alert]:has(.v-messages:empty){padding:0}.omega-input .v-btn{cursor:pointer;width:auto;appearance:none;box-shadow:none;display:block;min-width:auto;height:auto;padding:.5em .5em .5em 1em}")),document.head.appendChild(i),window.customElements){const e=window.customElements.define;window.customElements.define=function(s,t){const n=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(n&&n.call(this),this.shadowRoot){const a=document.createElement("style");a.appendChild(document.createTextNode(".omega-input .v-input__details:has(.v-messages:empty){grid-template-rows:0fr;transition:all .2s}.omega-input .v-messages:empty{min-height:0}.omega-input .v-input__details:has(.v-messages){transition:all .2s;overflow:hidden;min-height:0;display:grid;grid-template-rows:1fr}.omega-input .v-messages{transition:all .2s}.omega-input .v-messages>*{transition-duration:0s!important}.omega-input [role=alert]:has(.v-messages:empty){padding:0}.omega-input .v-btn{cursor:pointer;width:auto;appearance:none;box-shadow:none;display:block;min-width:auto;height:auto;padding:.5em .5em .5em 1em}")),this.shadowRoot.appendChild(a)}},e.call(window.customElements,s,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
import { defineComponent as
|
|
2
|
+
import { defineComponent as E, getCurrentInstance as V, useId as w, computed as a, watch as f, nextTick as N, onMounted as d, ref as $, watchEffect as k, renderSlot as B, normalizeProps as I, guardReactiveProps as _, createElementVNode as q, normalizeClass as L, createBlock as O, createCommentVNode as P, unref as F, openBlock as S, mergeProps as T } from "vue";
|
|
3
3
|
import { useStore as z } from "@tanstack/vue-form";
|
|
4
|
-
import
|
|
5
|
-
import D from "./vue-components.es40.js";
|
|
4
|
+
import A from "./vue-components.es27.js";
|
|
6
5
|
|
|
7
|
-
const
|
|
6
|
+
const G = /* @__PURE__ */ E({
|
|
8
7
|
inheritAttrs: !1,
|
|
9
8
|
__name: "OmegaInternalInput",
|
|
10
9
|
props: {
|
|
@@ -16,7 +15,7 @@ const J = /* @__PURE__ */ w({
|
|
|
16
15
|
validators: {}
|
|
17
16
|
},
|
|
18
17
|
setup(c) {
|
|
19
|
-
const e = c, v =
|
|
18
|
+
const e = c, v = V()?.appContext.components.VTextField, l = w(), o = e.field, r = z(o.store, (t) => t), m = a(() => e.type ? e.type : e.meta?.type === "string" ? e.meta.format === "email" ? "email" : "string" : e.meta?.type || "unknown"), n = a(() => r.value.value), g = a(
|
|
20
19
|
() => (
|
|
21
20
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
21
|
r.value.meta.errors.map((t) => t?.message).filter(Boolean)
|
|
@@ -34,15 +33,15 @@ const J = /* @__PURE__ */ w({
|
|
|
34
33
|
), d(() => {
|
|
35
34
|
!n.value && !e.meta?.required && e.meta?.nullableOrUndefined === "null" && o.setValue(null);
|
|
36
35
|
});
|
|
37
|
-
const { addError: h, removeError: b, showErrors:
|
|
36
|
+
const { addError: h, removeError: b, showErrors: x, showErrorsOn: C } = e.field.form.errorContext, s = $(!1);
|
|
38
37
|
k(() => {
|
|
39
|
-
(
|
|
38
|
+
(x.value || C === "onChange") && (s.value = !0);
|
|
40
39
|
});
|
|
41
|
-
const
|
|
40
|
+
const i = () => {
|
|
42
41
|
s.value = !0;
|
|
43
42
|
};
|
|
44
43
|
d(() => {
|
|
45
|
-
n.value &&
|
|
44
|
+
n.value && i();
|
|
46
45
|
});
|
|
47
46
|
const p = a(() => !s.value && m.value !== "select" ? [] : g.value);
|
|
48
47
|
f(
|
|
@@ -55,7 +54,7 @@ const J = /* @__PURE__ */ w({
|
|
|
55
54
|
}) : b(l);
|
|
56
55
|
}
|
|
57
56
|
);
|
|
58
|
-
const
|
|
57
|
+
const u = a(() => ({
|
|
59
58
|
id: l,
|
|
60
59
|
required: e.meta?.required,
|
|
61
60
|
minLength: e.meta?.type === "string" && e.meta?.minLength,
|
|
@@ -67,26 +66,26 @@ const J = /* @__PURE__ */ w({
|
|
|
67
66
|
errorMessages: p.value,
|
|
68
67
|
error: !!p.value.length,
|
|
69
68
|
field: e.field,
|
|
70
|
-
setRealDirty:
|
|
69
|
+
setRealDirty: i,
|
|
71
70
|
type: m.value,
|
|
72
71
|
label: `${e.label}${e.meta?.required ? " *" : ""}`,
|
|
73
72
|
options: e.options
|
|
74
73
|
}));
|
|
75
|
-
return (t,
|
|
76
|
-
|
|
77
|
-
class:
|
|
78
|
-
onFocusout:
|
|
74
|
+
return (t, M) => B(t.$slots, "default", I(_(u.value)), () => [
|
|
75
|
+
q("div", {
|
|
76
|
+
class: L(t.$attrs.class),
|
|
77
|
+
onFocusout: i
|
|
79
78
|
}, [
|
|
80
|
-
F(v) ? (S(),
|
|
79
|
+
F(v) ? (S(), O(A, T({
|
|
81
80
|
key: 0,
|
|
82
|
-
"input-props":
|
|
81
|
+
"input-props": u.value
|
|
83
82
|
}, t.$attrs, {
|
|
84
|
-
"vuetify-value":
|
|
83
|
+
"vuetify-value": u.value.field.state.value
|
|
85
84
|
}), null, 16, ["input-props", "vuetify-value"])) : P("", !0)
|
|
86
85
|
], 34)
|
|
87
86
|
]);
|
|
88
87
|
}
|
|
89
88
|
});
|
|
90
89
|
export {
|
|
91
|
-
|
|
90
|
+
G as default
|
|
92
91
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as r } from "./vue-components.es4.js";
|
|
2
2
|
import * as e from "./vue-components.es5.js";
|
|
3
|
-
import { createMeta as o, duplicateSchema as p, generateInputStandardSchemaFromFieldMeta as n, generateMetaFromSchema as u, nullableInput as l } from "./vue-components.es7.js";
|
|
3
|
+
import { createMeta as o, duplicateSchema as p, generateInputStandardSchemaFromFieldMeta as n, generateMetaFromSchema as u, getInputType as g, nullableInput as l } from "./vue-components.es7.js";
|
|
4
4
|
import { useOmegaForm as d } from "./vue-components.es6.js";
|
|
5
5
|
export {
|
|
6
6
|
e as OmegaErrorsContext,
|
|
7
|
-
|
|
7
|
+
r as OmegaInput,
|
|
8
8
|
o as createMeta,
|
|
9
9
|
p as duplicateSchema,
|
|
10
10
|
n as generateInputStandardSchemaFromFieldMeta,
|
|
11
11
|
u as generateMetaFromSchema,
|
|
12
|
+
g as getInputType,
|
|
12
13
|
l as nullableInput,
|
|
13
14
|
d as useOmegaForm
|
|
14
15
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as m, createElementBlock as d, openBlock as a, withModifiers as l, createElementVNode as u, unref as r, renderSlot as b } from "vue";
|
|
2
2
|
import { useStore as f } from "@tanstack/vue-form";
|
|
3
|
-
import { getOmegaStore as p } from "./vue-components.
|
|
3
|
+
import { getOmegaStore as p } from "./vue-components.es29.js";
|
|
4
4
|
const c = ["disabled"], V = /* @__PURE__ */ m({
|
|
5
5
|
__name: "OmegaWrapper",
|
|
6
6
|
props: {
|
|
@@ -1,13 +1,137 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
1
|
+
import { defineComponent as y, resolveComponent as s, createElementBlock as u, openBlock as o, createBlock as n, createCommentVNode as l, resolveDynamicComponent as a, mergeProps as i, unref as b, withCtx as f, Fragment as h, renderList as V } from "vue";
|
|
2
|
+
import { getInputType as C } from "./vue-components.es7.js";
|
|
3
|
+
const $ = /* @__PURE__ */ y({
|
|
4
|
+
inheritAttrs: !1,
|
|
5
|
+
__name: "OmegaInputVuetify",
|
|
6
|
+
props: {
|
|
7
|
+
inputProps: {},
|
|
8
|
+
vuetifyValue: {}
|
|
9
|
+
},
|
|
10
|
+
emits: ["focus", "blur"],
|
|
11
|
+
setup(q) {
|
|
12
|
+
return (e, p) => {
|
|
13
|
+
const t = s("v-text-field"), m = s("v-textarea"), d = s("v-radio"), P = s("v-radio-group"), g = s("v-select"), v = s("v-autocomplete");
|
|
14
|
+
return o(), u("div", {
|
|
15
|
+
class: "omega-input",
|
|
16
|
+
onFocusout: p[4] || (p[4] = (r) => e.$emit("blur", r)),
|
|
17
|
+
onFocusin: p[5] || (p[5] = (r) => e.$emit("focus", r))
|
|
18
|
+
}, [
|
|
19
|
+
e.inputProps.type === "boolean" || e.inputProps.type === "switch" ? (o(), n(a(e.inputProps.type === "boolean" ? "v-checkbox" : "v-switch"), i({
|
|
20
|
+
key: 0,
|
|
21
|
+
id: e.inputProps.id,
|
|
22
|
+
name: e.inputProps.name,
|
|
23
|
+
label: e.inputProps.label,
|
|
24
|
+
"error-messages": e.inputProps.errorMessages,
|
|
25
|
+
error: e.inputProps.error,
|
|
26
|
+
ripple: ""
|
|
27
|
+
}, e.$attrs, {
|
|
28
|
+
"model-value": e.vuetifyValue,
|
|
29
|
+
onChange: p[0] || (p[0] = (r) => e.inputProps.field.handleChange(r.target.checked))
|
|
30
|
+
}), null, 16, ["id", "name", "label", "error-messages", "error", "model-value"])) : l("", !0),
|
|
31
|
+
e.inputProps.type === "email" || e.inputProps.type === "string" || e.inputProps.type === "password" ? (o(), n(t, i({
|
|
32
|
+
key: 1,
|
|
33
|
+
id: e.inputProps.id,
|
|
34
|
+
required: e.inputProps.required,
|
|
35
|
+
"min-length": e.inputProps.minLength,
|
|
36
|
+
"max-length": e.inputProps.maxLength,
|
|
37
|
+
type: b(C)(e.inputProps.type),
|
|
38
|
+
name: e.inputProps.name,
|
|
39
|
+
label: e.inputProps.label,
|
|
40
|
+
"error-messages": e.inputProps.errorMessages,
|
|
41
|
+
error: e.inputProps.error
|
|
42
|
+
}, e.$attrs, {
|
|
43
|
+
"model-value": e.vuetifyValue,
|
|
44
|
+
"onUpdate:modelValue": e.inputProps.field.handleChange
|
|
45
|
+
}), null, 16, ["id", "required", "min-length", "max-length", "type", "name", "label", "error-messages", "error", "model-value", "onUpdate:modelValue"])) : l("", !0),
|
|
46
|
+
e.inputProps.type === "text" ? (o(), n(m, i({
|
|
47
|
+
key: 2,
|
|
48
|
+
id: e.inputProps.id,
|
|
49
|
+
required: e.inputProps.required,
|
|
50
|
+
"min-length": e.inputProps.minLength,
|
|
51
|
+
"max-length": e.inputProps.maxLength,
|
|
52
|
+
name: e.inputProps.name,
|
|
53
|
+
label: e.inputProps.label,
|
|
54
|
+
"error-messages": e.inputProps.errorMessages,
|
|
55
|
+
error: e.inputProps.error
|
|
56
|
+
}, e.$attrs, {
|
|
57
|
+
"model-value": e.vuetifyValue,
|
|
58
|
+
"onUpdate:modelValue": e.inputProps.field.handleChange
|
|
59
|
+
}), null, 16, ["id", "required", "min-length", "max-length", "name", "label", "error-messages", "error", "model-value", "onUpdate:modelValue"])) : l("", !0),
|
|
60
|
+
e.inputProps.type === "number" || e.inputProps.type === "range" ? (o(), n(a(e.inputProps.type === "range" ? "v-slider" : "v-text-field"), i({
|
|
61
|
+
key: 3,
|
|
62
|
+
id: e.inputProps.id,
|
|
63
|
+
required: e.inputProps.required,
|
|
64
|
+
min: e.inputProps.min,
|
|
65
|
+
max: e.inputProps.max,
|
|
66
|
+
type: e.inputProps.type,
|
|
67
|
+
name: e.inputProps.name,
|
|
68
|
+
label: e.inputProps.label,
|
|
69
|
+
"error-messages": e.inputProps.errorMessages,
|
|
70
|
+
error: e.inputProps.error
|
|
71
|
+
}, e.$attrs, {
|
|
72
|
+
"model-value": e.vuetifyValue,
|
|
73
|
+
"onUpdate:modelValue": p[1] || (p[1] = (r) => {
|
|
74
|
+
r || r === 0 ? e.inputProps.field.handleChange(Number(r)) : e.inputProps.field.handleChange(void 0);
|
|
75
|
+
})
|
|
76
|
+
}), null, 16, ["id", "required", "min", "max", "type", "name", "label", "error-messages", "error", "model-value"])) : l("", !0),
|
|
77
|
+
e.inputProps.type === "radio" ? (o(), n(P, i({
|
|
78
|
+
key: 4,
|
|
79
|
+
id: e.inputProps.id,
|
|
80
|
+
name: e.inputProps.name,
|
|
81
|
+
label: e.inputProps.label,
|
|
82
|
+
"error-messages": e.inputProps.errorMessages,
|
|
83
|
+
error: e.inputProps.error
|
|
84
|
+
}, e.$attrs, {
|
|
85
|
+
"model-value": e.vuetifyValue,
|
|
86
|
+
"onUpdate:modelValue": e.inputProps.field.handleChange
|
|
87
|
+
}), {
|
|
88
|
+
default: f(() => [
|
|
89
|
+
(o(!0), u(h, null, V(e.inputProps.options, (r) => (o(), n(d, {
|
|
90
|
+
key: r.value,
|
|
91
|
+
label: r.title,
|
|
92
|
+
value: r.value
|
|
93
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
94
|
+
]),
|
|
95
|
+
_: 1
|
|
96
|
+
}, 16, ["id", "name", "label", "error-messages", "error", "model-value", "onUpdate:modelValue"])) : l("", !0),
|
|
97
|
+
e.inputProps.type === "select" || e.inputProps.type === "multiple" ? (o(), n(g, i({
|
|
98
|
+
key: 5,
|
|
99
|
+
id: e.inputProps.id,
|
|
100
|
+
clearable: e.inputProps.type === "select",
|
|
101
|
+
required: e.inputProps.required,
|
|
102
|
+
multiple: e.inputProps.type === "multiple",
|
|
103
|
+
chips: e.inputProps.type === "multiple",
|
|
104
|
+
name: e.inputProps.name,
|
|
105
|
+
label: e.inputProps.label,
|
|
106
|
+
items: e.inputProps.options,
|
|
107
|
+
"error-messages": e.inputProps.errorMessages,
|
|
108
|
+
error: e.inputProps.error
|
|
109
|
+
}, e.$attrs, {
|
|
110
|
+
"model-value": e.vuetifyValue,
|
|
111
|
+
onClear: p[2] || (p[2] = (r) => e.inputProps.field.handleChange(void 0)),
|
|
112
|
+
"onUpdate:modelValue": e.inputProps.field.handleChange
|
|
113
|
+
}), null, 16, ["id", "clearable", "required", "multiple", "chips", "name", "label", "items", "error-messages", "error", "model-value", "onUpdate:modelValue"])) : l("", !0),
|
|
114
|
+
e.inputProps.type === "autocomplete" || e.inputProps.type === "autocompletemultiple" ? (o(), n(v, i({
|
|
115
|
+
key: 6,
|
|
116
|
+
id: e.inputProps.id,
|
|
117
|
+
clearable: e.inputProps.type === "autocomplete",
|
|
118
|
+
multiple: e.inputProps.type === "autocompletemultiple",
|
|
119
|
+
required: e.inputProps.required,
|
|
120
|
+
name: e.inputProps.name,
|
|
121
|
+
label: e.inputProps.label,
|
|
122
|
+
items: e.inputProps.options,
|
|
123
|
+
"error-messages": e.inputProps.errorMessages,
|
|
124
|
+
error: e.inputProps.error,
|
|
125
|
+
chips: e.inputProps.type === "autocompletemultiple"
|
|
126
|
+
}, e.$attrs, {
|
|
127
|
+
"model-value": e.vuetifyValue,
|
|
128
|
+
onClear: p[3] || (p[3] = (r) => e.inputProps.field.handleChange(void 0)),
|
|
129
|
+
"onUpdate:modelValue": e.inputProps.field.handleChange
|
|
130
|
+
}), null, 16, ["id", "clearable", "multiple", "required", "name", "label", "items", "error-messages", "error", "chips", "model-value", "onUpdate:modelValue"])) : l("", !0)
|
|
131
|
+
], 32);
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
});
|
|
11
135
|
export {
|
|
12
|
-
|
|
136
|
+
$ as default
|
|
13
137
|
};
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { useStore as u } from "@tanstack/vue-form";
|
|
2
|
+
import { computed as f } from "vue";
|
|
3
|
+
function c(o, t) {
|
|
4
|
+
return f(() => t ? u(o.store, (n) => {
|
|
5
|
+
const r = {};
|
|
6
|
+
for (const e of t)
|
|
7
|
+
r[e] = n[e];
|
|
8
|
+
return r;
|
|
9
|
+
}).value : {});
|
|
10
|
+
}
|
|
5
11
|
export {
|
|
6
|
-
|
|
12
|
+
c as getOmegaStore
|
|
7
13
|
};
|