@effect-app/vue-components 2.4.6 → 2.4.9
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/OmegaArray.vue.d.ts +2 -2
- package/dist/types/components/OmegaForm/OmegaAutoGen.vue.d.ts +5 -5
- package/dist/types/components/OmegaForm/OmegaFormInput.vue.d.ts +1 -1
- package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +14 -11
- package/dist/types/components/OmegaForm/OmegaInput.vue.d.ts +2 -3
- package/dist/types/components/OmegaForm/useOmegaForm.d.ts +71 -90
- package/dist/vue-components.es10.js +139 -122
- package/dist/vue-components.es22.js +1 -1
- package/dist/vue-components.es23.js +1 -1
- package/dist/vue-components.es40.js +23 -4
- package/dist/vue-components.es41.js +5 -23
- package/dist/vue-components.es42.js +21 -5
- package/dist/vue-components.es43.js +25 -16
- package/dist/vue-components.es44.js +15 -23
- package/dist/vue-components.es45.js +7 -17
- package/dist/vue-components.es46.js +5 -12
- package/dist/vue-components.es47.js +19 -5
- package/dist/vue-components.es48.js +9 -19
- package/dist/vue-components.es49.js +31 -9
- package/dist/vue-components.es50.js +42 -25
- package/dist/vue-components.es51.js +16 -38
- package/dist/vue-components.es52.js +4 -26
- package/dist/vue-components.es54.js +1 -1
- package/dist/vue-components.es56.js +1 -1
- package/dist/vue-components.es58.js +3 -3
- package/dist/vue-components.es59.js +1 -1
- package/package.json +1 -1
- package/src/components/OmegaForm/OmegaArray.vue +2 -3
- package/src/components/OmegaForm/OmegaAutoGen.vue +5 -6
- package/src/components/OmegaForm/OmegaFormInput.vue +2 -3
- package/src/components/OmegaForm/OmegaFormStuff.ts +12 -16
- package/src/components/OmegaForm/OmegaInput.vue +2 -3
- package/src/components/OmegaForm/useOmegaForm.ts +222 -466
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type DeepKeys } from "@tanstack/vue-form";
|
|
2
2
|
import { type OmegaArrayProps } from "./OmegaFormStuff";
|
|
3
|
-
declare const __VLS_export: <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any
|
|
4
|
-
props: __VLS_PrettifyLocal<OmegaArrayProps<From, To
|
|
3
|
+
declare const __VLS_export: <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<{
|
|
4
|
+
props: __VLS_PrettifyLocal<OmegaArrayProps<From, To>> & import("vue").PublicProps;
|
|
5
5
|
expose: (exposed: {}) => void;
|
|
6
6
|
attrs: any;
|
|
7
7
|
slots: {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { type DeepKeys } from "@tanstack/vue-form";
|
|
2
2
|
import { Order } from "effect-app";
|
|
3
3
|
import { type OmegaAutoGenMeta, type OmegaInputProps } from "./OmegaFormStuff";
|
|
4
|
-
declare const __VLS_export: <From extends Record<PropertyKey, string>, To extends Record<PropertyKey, string
|
|
4
|
+
declare const __VLS_export: <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<{
|
|
5
5
|
props: __VLS_PrettifyLocal<{
|
|
6
|
-
form: OmegaInputProps<From, To
|
|
6
|
+
form: OmegaInputProps<From, To>["form"];
|
|
7
7
|
pick?: DeepKeys<From>[];
|
|
8
8
|
omit?: DeepKeys<From>[];
|
|
9
9
|
labelMap?: (key: DeepKeys<From>) => string | undefined;
|
|
10
|
-
filterMap?: <M extends OmegaAutoGenMeta<From, To
|
|
10
|
+
filterMap?: <M extends OmegaAutoGenMeta<From, To>>(key: DeepKeys<From>, meta: M) => boolean | M;
|
|
11
11
|
order?: DeepKeys<From>[];
|
|
12
|
-
sort?: Order.Order<OmegaAutoGenMeta<From, To
|
|
12
|
+
sort?: Order.Order<OmegaAutoGenMeta<From, To>>;
|
|
13
13
|
}> & import("vue").PublicProps;
|
|
14
14
|
expose: (exposed: {}) => void;
|
|
15
15
|
attrs: any;
|
|
16
16
|
slots: {
|
|
17
17
|
default(props: {
|
|
18
|
-
child: OmegaAutoGenMeta<From, To
|
|
18
|
+
child: OmegaAutoGenMeta<From, To>;
|
|
19
19
|
}): void;
|
|
20
20
|
};
|
|
21
21
|
emit: {};
|
|
@@ -2,7 +2,7 @@ import { type DeepKeys } from "@tanstack/vue-form";
|
|
|
2
2
|
import type { MergedInputProps } from "./InputProps";
|
|
3
3
|
import type { BaseProps, DefaultTypeProps } from "./OmegaFormStuff";
|
|
4
4
|
declare const __VLS_export: <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<BaseProps<From
|
|
5
|
+
props: __VLS_PrettifyLocal<BaseProps<From> & DefaultTypeProps> & import("vue").PublicProps;
|
|
6
6
|
expose: (exposed: {}) => void;
|
|
7
7
|
attrs: any;
|
|
8
8
|
slots: {
|
|
@@ -3,13 +3,16 @@ import { type DeepKeys, type DeepValue, type FieldAsyncValidateOrFn, type FieldV
|
|
|
3
3
|
import { type RuntimeFiber } from "effect/Fiber";
|
|
4
4
|
import { type OmegaFieldInternalApi } from "./InputProps";
|
|
5
5
|
import { type OF, type OmegaFormReturn } from "./useOmegaForm";
|
|
6
|
-
|
|
7
|
-
[K in keyof T]:
|
|
6
|
+
type Compute<T> = {
|
|
7
|
+
[K in keyof T]: T[K];
|
|
8
|
+
} & {};
|
|
9
|
+
export type FieldPath<T> = unknown extends T ? string : T extends string | boolean | number | null | undefined | symbol | bigint ? "" : T extends ReadonlyArray<infer U> ? Compute<FieldPath_<U, `[${number}]`>> : {
|
|
10
|
+
[K in keyof T]: Compute<FieldPath_<T[K], `${K & string}`>>;
|
|
8
11
|
}[keyof T];
|
|
9
|
-
export type FieldPath_<T, Path extends string> = unknown extends T ? string : T extends string | boolean | number | null | undefined | symbol | bigint ? Path : T extends ReadonlyArray<infer U> ? FieldPath_<U, `${Path}[${number}]
|
|
10
|
-
[K in keyof T]: FieldPath_<T[K], `${Path}.${K & string}
|
|
12
|
+
export type FieldPath_<T, Path extends string> = unknown extends T ? string : T extends string | boolean | number | null | undefined | symbol | bigint ? Path : T extends ReadonlyArray<infer U> ? Compute<FieldPath_<U, `${Path}[${number}]`>> | Path : {
|
|
13
|
+
[K in keyof T]: Compute<FieldPath_<T[K], `${Path}.${K & string}`>>;
|
|
11
14
|
}[keyof T];
|
|
12
|
-
export type BaseProps<From, TName extends FieldPath<From>> = {
|
|
15
|
+
export type BaseProps<From, TName extends FieldPath<From> = FieldPath<From>> = {
|
|
13
16
|
/**
|
|
14
17
|
* Will fallback to i18n when not specified.
|
|
15
18
|
* Can also be provided via #label slot for custom HTML labels.
|
|
@@ -37,19 +40,19 @@ export type DefaultTypeProps = {
|
|
|
37
40
|
value: unknown;
|
|
38
41
|
}[];
|
|
39
42
|
};
|
|
40
|
-
export type OmegaInputPropsBase<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any
|
|
43
|
+
export type OmegaInputPropsBase<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>> = {
|
|
41
44
|
form: OF<From, To> & {
|
|
42
45
|
meta: MetaRecord<From>;
|
|
43
46
|
i18nNamespace?: string;
|
|
44
47
|
};
|
|
45
|
-
} & BaseProps<From
|
|
46
|
-
export type OmegaInputProps<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>,
|
|
48
|
+
} & BaseProps<From>;
|
|
49
|
+
export type OmegaInputProps<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, TypeProps = DefaultTypeProps> = {
|
|
47
50
|
form: OmegaFormReturn<From, To, TypeProps> & {
|
|
48
51
|
meta: MetaRecord<From>;
|
|
49
52
|
i18nNamespace?: string;
|
|
50
53
|
};
|
|
51
|
-
} & BaseProps<From
|
|
52
|
-
export type OmegaArrayProps<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any
|
|
54
|
+
} & BaseProps<From>;
|
|
55
|
+
export type OmegaArrayProps<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>> = Omit<OmegaInputProps<From, To>, "validators" | "options" | "label" | "type" | "items" | "name"> & {
|
|
53
56
|
name: DeepKeys<From>;
|
|
54
57
|
defaultItems?: DeepValue<From, DeepKeys<From>>;
|
|
55
58
|
items?: "please use `defaultItems` instead";
|
|
@@ -146,7 +149,7 @@ export declare const generateInputStandardSchemaFromFieldMeta: (meta: FieldMeta)
|
|
|
146
149
|
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>> & {
|
|
147
150
|
withDefault: S.PropertySignature<":", A | null, never, ":", I | null, true, R>;
|
|
148
151
|
}, S.SchemaClass<A, A, never>>;
|
|
149
|
-
export type OmegaAutoGenMeta<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any
|
|
152
|
+
export type OmegaAutoGenMeta<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>> = Omit<OmegaInputProps<From, To>, "form">;
|
|
150
153
|
declare const supportedInputs: readonly ["button", "checkbox", "color", "date", "email", "number", "password", "radio", "range", "search", "submit", "tel", "text", "time", "url"];
|
|
151
154
|
export type SupportedInputs = typeof supportedInputs[number];
|
|
152
155
|
export declare const getInputType: (input: string) => SupportedInputs;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { type DeepKeys } from "@tanstack/vue-form";
|
|
2
1
|
import { type OmegaInputPropsBase } from "./OmegaFormStuff";
|
|
3
|
-
declare const __VLS_export: <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any
|
|
4
|
-
props: __VLS_PrettifyLocal<OmegaInputPropsBase<From, To
|
|
2
|
+
declare const __VLS_export: <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<OmegaInputPropsBase<From, To>> & import("vue").PublicProps;
|
|
5
4
|
expose: (exposed: {}) => void;
|
|
6
5
|
attrs: any;
|
|
7
6
|
slots: {
|
|
@@ -2,7 +2,7 @@ import { type DeepKeys, DeepValue, StandardSchemaV1Issue, ValidationError, Valid
|
|
|
2
2
|
import { Effect, Order, S } from "effect-app";
|
|
3
3
|
import { ComputedRef, type InjectionKey } from "vue";
|
|
4
4
|
import { MergedInputProps } from "./InputProps";
|
|
5
|
-
import { BaseProps, DefaultTypeProps, FieldPath, type FormProps, type MetaRecord, type NestedKeyOf,
|
|
5
|
+
import { BaseProps, DefaultTypeProps, FieldPath, type FormProps, type MetaRecord, type NestedKeyOf, OmegaAutoGenMeta, OmegaError, type OmegaFormApi, OmegaFormState } from "./OmegaFormStuff";
|
|
6
6
|
type keysRule<T> = {
|
|
7
7
|
keys?: NestedKeyOf<T>[];
|
|
8
8
|
banKeys?: "You should only use one of banKeys or keys, not both, moron";
|
|
@@ -73,123 +73,104 @@ export interface OF<From, To> extends OmegaFormApi<From, To> {
|
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
export declare const OmegaFormKey: InjectionKey<OF<any, any>>;
|
|
76
|
-
type __VLS_PrettifyLocal<T> = {
|
|
77
|
-
[K in keyof T]: T[K];
|
|
78
|
-
} & {};
|
|
79
76
|
export interface OmegaFormReturn<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, TypeProps = DefaultTypeProps> extends OF<From, To> {
|
|
80
|
-
Input: <Name extends FieldPath<From>>(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
slots
|
|
85
|
-
default?(props: MergedInputProps<From, Name>):
|
|
77
|
+
Input: <Name extends FieldPath<From>>(props: BaseProps<From, Name> & TypeProps & {
|
|
78
|
+
key?: string | number;
|
|
79
|
+
ref?: any;
|
|
80
|
+
}, context?: {
|
|
81
|
+
slots?: {
|
|
82
|
+
default?(props: MergedInputProps<From, Name>): any;
|
|
86
83
|
label?: (props: {
|
|
87
84
|
required: boolean;
|
|
88
85
|
id: string;
|
|
89
86
|
label: string;
|
|
90
|
-
}) =>
|
|
87
|
+
}) => any;
|
|
91
88
|
};
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
attrs: any;
|
|
100
|
-
slots: {
|
|
89
|
+
attrs?: Record<string, any>;
|
|
90
|
+
}) => import("vue").VNode;
|
|
91
|
+
Errors: (props?: {
|
|
92
|
+
key?: string | number;
|
|
93
|
+
ref?: any;
|
|
94
|
+
}, context?: {
|
|
95
|
+
slots?: {
|
|
101
96
|
default: (props: {
|
|
102
97
|
errors: readonly OmegaError[];
|
|
103
98
|
showedGeneralErrors: string[];
|
|
104
|
-
}) =>
|
|
99
|
+
}) => any;
|
|
105
100
|
};
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
118
|
-
attrs: any;
|
|
119
|
-
slots: Record<string, (props: {
|
|
101
|
+
attrs?: Record<string, any>;
|
|
102
|
+
}) => import("vue").VNode;
|
|
103
|
+
TaggedUnion: <Name extends DeepKeys<From>>(props: {
|
|
104
|
+
name: Name;
|
|
105
|
+
type?: "select" | "radio";
|
|
106
|
+
options: import("./InputProps").TaggedUnionOptionsArray<From, Name>;
|
|
107
|
+
label?: string;
|
|
108
|
+
key?: string | number;
|
|
109
|
+
ref?: any;
|
|
110
|
+
}, context?: {
|
|
111
|
+
slots?: Record<string, (props: {
|
|
120
112
|
field: import("@tanstack/vue-form").FieldApi<From, Name, DeepValue<From, Name>, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
|
|
121
113
|
state: import("@tanstack/vue-form").FieldState<From, Name, DeepValue<From, Name>, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
|
|
122
114
|
}) => any>;
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
slots
|
|
115
|
+
attrs?: Record<string, any>;
|
|
116
|
+
}) => import("vue").VNode;
|
|
117
|
+
Array: <Name extends DeepKeys<From>>(props: {
|
|
118
|
+
name: Name;
|
|
119
|
+
defaultItems?: DeepValue<From, Name>;
|
|
120
|
+
key?: string | number;
|
|
121
|
+
ref?: any;
|
|
122
|
+
}, context?: {
|
|
123
|
+
slots?: {
|
|
132
124
|
"pre-array"?: (props: {
|
|
133
|
-
field:
|
|
134
|
-
state:
|
|
125
|
+
field: any;
|
|
126
|
+
state: any;
|
|
135
127
|
}) => any;
|
|
136
|
-
} & {
|
|
137
128
|
default?: (props: {
|
|
138
|
-
subField:
|
|
139
|
-
subState:
|
|
129
|
+
subField: any;
|
|
130
|
+
subState: any;
|
|
140
131
|
index: number;
|
|
141
|
-
field:
|
|
132
|
+
field: any;
|
|
142
133
|
}) => any;
|
|
143
|
-
} & {
|
|
144
134
|
"post-array"?: (props: {
|
|
145
|
-
field:
|
|
146
|
-
state:
|
|
135
|
+
field: any;
|
|
136
|
+
state: any;
|
|
147
137
|
}) => any;
|
|
148
|
-
} & {
|
|
149
138
|
field?: (props: {
|
|
150
|
-
field:
|
|
139
|
+
field: any;
|
|
151
140
|
}) => any;
|
|
152
141
|
};
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
167
|
-
attrs: any;
|
|
168
|
-
slots: {
|
|
142
|
+
attrs?: Record<string, any>;
|
|
143
|
+
}) => import("vue").VNode;
|
|
144
|
+
AutoGen: (props: {
|
|
145
|
+
pick?: DeepKeys<From>[];
|
|
146
|
+
omit?: DeepKeys<From>[];
|
|
147
|
+
labelMap?: (key: DeepKeys<From>) => string | undefined;
|
|
148
|
+
filterMap?: <M extends OmegaAutoGenMeta<From, To>>(key: DeepKeys<From>, meta: M) => boolean | M;
|
|
149
|
+
order?: DeepKeys<From>[];
|
|
150
|
+
sort?: Order.Order<OmegaAutoGenMeta<From, To>>;
|
|
151
|
+
key?: string | number;
|
|
152
|
+
ref?: any;
|
|
153
|
+
}, context?: {
|
|
154
|
+
slots?: {
|
|
169
155
|
default(props: {
|
|
170
|
-
child: OmegaAutoGenMeta<From, To
|
|
171
|
-
}):
|
|
156
|
+
child: OmegaAutoGenMeta<From, To>;
|
|
157
|
+
}): any;
|
|
172
158
|
};
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
183
|
-
attrs: any;
|
|
184
|
-
slots: {
|
|
159
|
+
attrs?: Record<string, any>;
|
|
160
|
+
}) => import("vue").VNode;
|
|
161
|
+
Form: <K extends keyof OmegaFormState<From, To>>(props: {
|
|
162
|
+
disabled?: boolean;
|
|
163
|
+
subscribe?: K[];
|
|
164
|
+
key?: string | number;
|
|
165
|
+
ref?: any;
|
|
166
|
+
}, context?: {
|
|
167
|
+
slots?: {
|
|
185
168
|
default(props: {
|
|
186
169
|
subscribedValues: K[] extends undefined[] ? Record<string, never> : Pick<OmegaFormState<From, To>, K>;
|
|
187
|
-
}):
|
|
170
|
+
}): any;
|
|
188
171
|
};
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
__ctx?: Awaited<typeof __VLS_setup>;
|
|
192
|
-
};
|
|
172
|
+
attrs?: Record<string, any>;
|
|
173
|
+
}) => import("vue").VNode;
|
|
193
174
|
}
|
|
194
175
|
export declare const useOmegaForm: <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, TypeProps = DefaultTypeProps>(schema: S.Schema<To, From, never>, tanstackFormOptions?: NoInfer<FormProps<From, To>>, omegaConfig?: OmegaConfig<To>) => OmegaFormReturn<From, To, TypeProps>;
|
|
195
176
|
export {};
|