@effect-app/vue-components 4.0.0-beta.31 → 4.0.0-beta.310
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/README.md +13 -9
- package/dist/reset.css +39 -38
- package/dist/types/components/CommandButton.vue.d.ts +24 -5
- package/dist/types/components/Dialog.vue.d.ts +3 -1
- package/dist/types/components/FixedNuxtErrorBoundary.vue.d.ts +39 -0
- package/dist/types/components/OmegaForm/InputProps.d.ts +1 -1
- package/dist/types/components/OmegaForm/OmegaArray.vue.d.ts +1 -1
- package/dist/types/components/OmegaForm/OmegaAutoGen.vue.d.ts +2 -2
- package/dist/types/components/OmegaForm/OmegaErrorsInternal.vue.d.ts +1 -1
- package/dist/types/components/OmegaForm/OmegaFormInput.vue.d.ts +1 -1
- package/dist/types/components/OmegaForm/OmegaInput.vue.d.ts +1 -1
- package/dist/types/components/OmegaForm/OmegaInputVuetify.vue.d.ts +6 -0
- package/dist/types/components/OmegaForm/OmegaInternalInput.vue.d.ts +6 -9
- package/dist/types/components/OmegaForm/OmegaTaggedUnion.vue.d.ts +2 -2
- package/dist/types/components/OmegaForm/OmegaTaggedUnionInternal.vue.d.ts +3 -3
- package/dist/types/components/OmegaForm/OmegaWrapper.vue.d.ts +1 -1
- package/dist/types/components/OmegaForm/createUseFormWithCustomInput.d.ts +4 -2
- package/dist/types/components/OmegaForm/errors.d.ts +33 -0
- package/dist/types/components/OmegaForm/getOmegaStore.d.ts +1 -1
- package/dist/types/components/OmegaForm/hocs.d.ts +3 -0
- package/dist/types/components/OmegaForm/index.d.ts +14 -3
- package/dist/types/components/OmegaForm/inputs.d.ts +4 -0
- package/dist/types/components/OmegaForm/meta/checks.d.ts +4 -0
- package/dist/types/components/OmegaForm/meta/createMeta.d.ts +33 -0
- package/dist/types/components/OmegaForm/meta/defaults.d.ts +21 -0
- package/dist/types/components/OmegaForm/meta/redacted.d.ts +2 -0
- package/dist/types/components/OmegaForm/meta/types.d.ts +56 -0
- package/dist/types/components/OmegaForm/meta/walker.d.ts +18 -0
- package/dist/types/components/OmegaForm/persistency.d.ts +58 -0
- package/dist/types/components/OmegaForm/submit.d.ts +60 -0
- package/dist/types/components/OmegaForm/types.d.ts +312 -0
- package/dist/types/components/OmegaForm/useOmegaForm.d.ts +9 -213
- package/dist/types/components/OmegaForm/validation/localized.d.ts +10 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/types/utils/index.d.ts +8 -8
- package/dist/vue-components.es.js +30 -44
- package/dist/vue-components10.es.js +5 -0
- package/dist/vue-components11.es.js +56 -0
- package/dist/vue-components12.es.js +5 -0
- package/dist/vue-components13.es.js +20 -0
- package/dist/vue-components14.es.js +49 -0
- package/dist/vue-components15.es.js +128 -0
- package/dist/vue-components16.es.js +65 -0
- package/dist/vue-components17.es.js +114 -0
- package/dist/vue-components18.es.js +22 -0
- package/dist/vue-components19.es.js +5 -0
- package/dist/vue-components2.es.js +11 -0
- package/dist/vue-components20.es.js +80 -0
- package/dist/vue-components21.es.js +93 -0
- package/dist/vue-components22.es.js +73 -0
- package/dist/vue-components23.es.js +12 -0
- package/dist/vue-components24.es.js +57 -0
- package/dist/vue-components25.es.js +5 -0
- package/dist/vue-components26.es.js +44 -0
- package/dist/vue-components27.es.js +5 -0
- package/dist/vue-components28.es.js +84 -0
- package/dist/vue-components3.es.js +98 -0
- package/dist/vue-components30.es.js +8 -0
- package/dist/vue-components31.es.js +9 -0
- package/dist/vue-components32.es.js +24 -0
- package/dist/vue-components33.es.js +300 -0
- package/dist/vue-components35.es.js +8 -0
- package/dist/vue-components36.es.js +73 -0
- package/dist/vue-components37.es.js +5 -0
- package/dist/vue-components38.es.js +64 -0
- package/dist/vue-components39.es.js +5 -0
- package/dist/vue-components4.es.js +5 -0
- package/dist/vue-components40.es.js +24 -0
- package/dist/vue-components41.es.js +5 -0
- package/dist/vue-components42.es.js +59 -0
- package/dist/vue-components43.es.js +5 -0
- package/dist/vue-components44.es.js +12 -0
- package/dist/vue-components45.es.js +22 -0
- package/dist/vue-components47.es.js +9 -0
- package/dist/vue-components48.es.js +4 -0
- package/dist/vue-components49.es.js +38 -0
- package/dist/vue-components5.es.js +24 -0
- package/dist/vue-components50.es.js +27 -0
- package/dist/vue-components51.es.js +28 -0
- package/dist/vue-components52.es.js +7 -0
- package/dist/vue-components53.es.js +18 -0
- package/dist/vue-components54.es.js +36 -0
- package/dist/vue-components55.es.js +18 -0
- package/dist/vue-components56.es.js +21 -0
- package/dist/vue-components57.es.js +30 -0
- package/dist/vue-components58.es.js +7 -0
- package/dist/vue-components59.es.js +9 -0
- package/dist/vue-components6.es.js +13 -0
- package/dist/vue-components60.es.js +38 -0
- package/dist/vue-components61.es.js +25 -0
- package/dist/vue-components62.es.js +128 -0
- package/dist/vue-components63.es.js +24 -0
- package/dist/vue-components64.es.js +21 -0
- package/dist/vue-components65.es.js +9 -0
- package/dist/vue-components66.es.js +19 -0
- package/dist/vue-components67.es.js +5 -0
- package/dist/vue-components68.es.js +29 -0
- package/dist/vue-components69.es.js +5 -0
- package/dist/vue-components7.es.js +13 -0
- package/dist/vue-components70.es.js +43 -0
- package/dist/vue-components71.es.js +101 -0
- package/dist/vue-components72.es.js +36 -0
- package/dist/vue-components73.es.js +19 -0
- package/dist/vue-components74.es.js +50 -0
- package/dist/vue-components8.es.js +35 -0
- package/dist/vue-components9.es.js +47 -0
- package/package.json +39 -33
- package/src/components/CommandButton.vue +96 -16
- package/src/components/Dialog.vue +0 -1
- package/src/components/FixedNuxtErrorBoundary.vue +112 -0
- package/src/components/OmegaForm/InputProps.ts +1 -1
- package/src/components/OmegaForm/OmegaArray.vue +8 -9
- package/src/components/OmegaForm/OmegaAutoGen.vue +3 -2
- package/src/components/OmegaForm/OmegaErrorsInternal.vue +1 -1
- package/src/components/OmegaForm/OmegaFormInput.vue +1 -1
- package/src/components/OmegaForm/OmegaInput.vue +26 -40
- package/src/components/OmegaForm/OmegaInputVuetify.vue +58 -8
- package/src/components/OmegaForm/OmegaInternalInput.vue +32 -13
- package/src/components/OmegaForm/OmegaTaggedUnion.vue +10 -3
- package/src/components/OmegaForm/OmegaTaggedUnionInternal.vue +6 -6
- package/src/components/OmegaForm/OmegaWrapper.vue +1 -1
- package/src/components/OmegaForm/blockDialog.ts +18 -6
- package/src/components/OmegaForm/createUseFormWithCustomInput.ts +16 -14
- package/src/components/OmegaForm/errors.ts +136 -0
- package/src/components/OmegaForm/getOmegaStore.ts +1 -1
- package/src/components/OmegaForm/hocs.ts +19 -0
- package/src/components/OmegaForm/index.ts +17 -4
- package/src/components/OmegaForm/inputs.ts +22 -0
- package/src/components/OmegaForm/meta/checks.ts +82 -0
- package/src/components/OmegaForm/meta/createMeta.ts +140 -0
- package/src/components/OmegaForm/meta/defaults.ts +262 -0
- package/src/components/OmegaForm/meta/redacted.ts +66 -0
- package/src/components/OmegaForm/meta/types.ts +78 -0
- package/src/components/OmegaForm/meta/walker.ts +248 -0
- package/src/components/OmegaForm/persistency.ts +247 -0
- package/src/components/OmegaForm/submit.ts +131 -0
- package/src/components/OmegaForm/types.ts +801 -0
- package/src/components/OmegaForm/useOmegaForm.ts +103 -896
- package/src/components/OmegaForm/useRegisterField.ts +1 -1
- package/src/components/OmegaForm/validation/localized.ts +203 -0
- package/src/components/index.ts +1 -0
- package/src/index.ts +0 -1
- package/src/reset.css +39 -38
- package/src/utils/index.ts +11 -8
- package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +0 -159
- package/dist/types/constants/index.d.ts +0 -1
- package/dist/vue-components.es10.js +0 -239
- package/dist/vue-components.es11.js +0 -32
- package/dist/vue-components.es12.js +0 -503
- package/dist/vue-components.es13.js +0 -49
- package/dist/vue-components.es14.js +0 -4
- package/dist/vue-components.es15.js +0 -4
- package/dist/vue-components.es16.js +0 -6
- package/dist/vue-components.es17.js +0 -13
- package/dist/vue-components.es18.js +0 -57
- package/dist/vue-components.es19.js +0 -56
- package/dist/vue-components.es2.js +0 -30
- package/dist/vue-components.es20.js +0 -8
- package/dist/vue-components.es21.js +0 -8
- package/dist/vue-components.es22.js +0 -5
- package/dist/vue-components.es23.js +0 -5
- package/dist/vue-components.es24.js +0 -4
- package/dist/vue-components.es25.js +0 -4
- package/dist/vue-components.es26.js +0 -4
- package/dist/vue-components.es27.js +0 -4
- package/dist/vue-components.es28.js +0 -19
- package/dist/vue-components.es29.js +0 -13
- package/dist/vue-components.es3.js +0 -17
- package/dist/vue-components.es30.js +0 -194
- package/dist/vue-components.es32.js +0 -31
- package/dist/vue-components.es33.js +0 -6
- package/dist/vue-components.es34.js +0 -4
- package/dist/vue-components.es35.js +0 -4
- package/dist/vue-components.es36.js +0 -113
- package/dist/vue-components.es38.js +0 -9
- package/dist/vue-components.es39.js +0 -34
- package/dist/vue-components.es4.js +0 -52
- package/dist/vue-components.es41.js +0 -6
- package/dist/vue-components.es42.js +0 -25
- package/dist/vue-components.es43.js +0 -7
- package/dist/vue-components.es44.js +0 -23
- package/dist/vue-components.es45.js +0 -32
- package/dist/vue-components.es46.js +0 -24
- package/dist/vue-components.es47.js +0 -14
- package/dist/vue-components.es48.js +0 -7
- package/dist/vue-components.es49.js +0 -21
- package/dist/vue-components.es5.js +0 -52
- package/dist/vue-components.es50.js +0 -11
- package/dist/vue-components.es51.js +0 -33
- package/dist/vue-components.es52.js +0 -50
- package/dist/vue-components.es53.js +0 -28
- package/dist/vue-components.es54.js +0 -13
- package/dist/vue-components.es55.js +0 -67
- package/dist/vue-components.es56.js +0 -58
- package/dist/vue-components.es57.js +0 -19
- package/dist/vue-components.es58.js +0 -35
- package/dist/vue-components.es59.js +0 -31
- package/dist/vue-components.es6.js +0 -69
- package/dist/vue-components.es60.js +0 -44
- package/dist/vue-components.es61.js +0 -4
- package/dist/vue-components.es62.js +0 -46
- package/dist/vue-components.es63.js +0 -4
- package/dist/vue-components.es7.js +0 -83
- package/dist/vue-components.es8.js +0 -63
- package/dist/vue-components.es9.js +0 -21
- package/src/components/OmegaForm/OmegaFormStuff.ts +0 -1276
- package/src/constants/index.ts +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as S from "effect-app/Schema";
|
|
2
|
+
import type { FieldMeta, MetaRecord } from "./types";
|
|
3
|
+
export type WalkerContext<T> = {
|
|
4
|
+
acc: Partial<MetaRecord<T>>;
|
|
5
|
+
unionMeta: Record<string, MetaRecord<T>>;
|
|
6
|
+
};
|
|
7
|
+
export type ParentMeta = {
|
|
8
|
+
required: boolean;
|
|
9
|
+
nullableOrUndefined: false | "null" | "undefined";
|
|
10
|
+
/** Set when iterating the members of a nullable discriminated union */
|
|
11
|
+
isNullableDiscriminatedUnion?: boolean;
|
|
12
|
+
/** Set when this property was declared with S.optionalKey */
|
|
13
|
+
isOptionalKey?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare const leafMetaForAst: (ast: S.AST.AST, parentMeta: ParentMeta) => FieldMeta;
|
|
16
|
+
export declare const walkStruct: <T>(propertySignatures: readonly S.AST.PropertySignature[], parent: string, parentMeta: ParentMeta, ctx: WalkerContext<T>) => void;
|
|
17
|
+
export declare const classifyAndWalkUnion: <T>(unionAst: S.AST.Union, key: string, parentMeta: ParentMeta, ctx: WalkerContext<T>) => void;
|
|
18
|
+
export declare const walk: <T>(ast: S.AST.AST, key: string, parentMeta: ParentMeta, ctx: WalkerContext<T>) => void;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type ComputedRef } from "vue";
|
|
2
|
+
import { type MetaRecord } from "./meta/types";
|
|
3
|
+
export type Policies = "local" | "session" | "querystring";
|
|
4
|
+
export type DefaultValuesPriorityUnion = "tanstack" | "persistency" | "schema";
|
|
5
|
+
export type defaultValuesPriorityUnion = DefaultValuesPriorityUnion;
|
|
6
|
+
export interface PersistencyConfig {
|
|
7
|
+
/** Order of importance:
|
|
8
|
+
* - "querystring": Highest priority when persisting
|
|
9
|
+
* - "local" and then "session": Lower priority storage options
|
|
10
|
+
*/
|
|
11
|
+
policies?: ReadonlyArray<Policies>;
|
|
12
|
+
overrideDefaultValues?: "deprecated: use defaultValuesPriority";
|
|
13
|
+
id?: string;
|
|
14
|
+
keys?: ReadonlyArray<string> | "You should only use one of banKeys or keys, not both, moron";
|
|
15
|
+
banKeys?: ReadonlyArray<string> | "You should only use one of banKeys or keys, not both, moron";
|
|
16
|
+
}
|
|
17
|
+
export declare function deepMerge(target: any, source: any): any;
|
|
18
|
+
export interface UsePersistencyOptions<From> {
|
|
19
|
+
meta: MetaRecord<From>;
|
|
20
|
+
persistency?: PersistencyConfig;
|
|
21
|
+
preventWindowExit?: "prevent" | "prevent-and-reset" | "nope";
|
|
22
|
+
defaultValuesPriority?: DefaultValuesPriorityUnion[] | readonly DefaultValuesPriorityUnion[];
|
|
23
|
+
/** Tanstack-provided default values (highest priority by default). */
|
|
24
|
+
tanstackDefaultValues?: any;
|
|
25
|
+
/** Lazy schema-derived defaults factory. */
|
|
26
|
+
schemaDefaultValues: () => any;
|
|
27
|
+
/**
|
|
28
|
+
* Lazy accessor for the form. Lazy because persistency is created BEFORE
|
|
29
|
+
* the form (its `defaultValues` are passed into `useForm`), but the
|
|
30
|
+
* persistence callbacks (`persistData`, `saveDataInUrl`, the
|
|
31
|
+
* `beforeunload` listener) only run later and need the live form.
|
|
32
|
+
*/
|
|
33
|
+
getForm: () => {
|
|
34
|
+
store: {
|
|
35
|
+
state: {
|
|
36
|
+
values: any;
|
|
37
|
+
isDirty: boolean;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
getFieldValue: (path: any) => any;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface UsePersistencyReturn {
|
|
44
|
+
defaultValues: ComputedRef;
|
|
45
|
+
persistencyKey: ComputedRef<string>;
|
|
46
|
+
persistData: () => void;
|
|
47
|
+
saveDataInUrl: () => void;
|
|
48
|
+
clearUrlParams: () => void;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Encapsulates form-data persistency: loading default values from
|
|
52
|
+
* localStorage / sessionStorage / querystring, persisting them on unmount
|
|
53
|
+
* or window blur, and the optional `preventWindowExit` warning listener.
|
|
54
|
+
*
|
|
55
|
+
* The `prevent-and-reset` reset-on-success behavior is intentionally NOT
|
|
56
|
+
* owned here — the consumer wires that to its own form submit lifecycle.
|
|
57
|
+
*/
|
|
58
|
+
export declare const usePersistency: <From>(opts: UsePersistencyOptions<From>) => UsePersistencyReturn;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as api from "@opentelemetry/api";
|
|
2
|
+
import type { DeepKeys, StandardSchemaV1Issue, ValidationError, ValidationErrorMap } from "@tanstack/vue-form";
|
|
3
|
+
import * as Effect from "effect-app/Effect";
|
|
4
|
+
import type { Fiber as EffectFiber } from "effect/Fiber";
|
|
5
|
+
import type { OmegaFormApi, OmegaFormParams } from "./types";
|
|
6
|
+
declare const FormErrors_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
7
|
+
readonly _tag: "FormErrors";
|
|
8
|
+
} & Readonly<A>;
|
|
9
|
+
export declare class FormErrors<From> extends FormErrors_base<{
|
|
10
|
+
form: {
|
|
11
|
+
errors: (Record<string, StandardSchemaV1Issue[]> | undefined)[];
|
|
12
|
+
errorMap: ValidationErrorMap<undefined, undefined, Record<string, StandardSchemaV1Issue[]>, undefined, undefined, undefined, undefined, undefined, undefined, undefined>;
|
|
13
|
+
};
|
|
14
|
+
fields: Record<DeepKeys<From>, {
|
|
15
|
+
errors: ValidationError[];
|
|
16
|
+
errorMap: ValidationErrorMap;
|
|
17
|
+
}>;
|
|
18
|
+
}> {
|
|
19
|
+
}
|
|
20
|
+
export declare const wrapWithSpan: (span: api.Span | undefined, toWrap: () => any) => any;
|
|
21
|
+
export type UserOnSubmit<From, To> = (props: {
|
|
22
|
+
formApi: OmegaFormParams<From, To>;
|
|
23
|
+
meta: any;
|
|
24
|
+
value: To;
|
|
25
|
+
}) => Promise<any> | EffectFiber<any, any> | Effect.Effect<unknown, any>;
|
|
26
|
+
export type RunPromise = <A, E>(eff: Effect.Effect<A, E>) => Promise<A>;
|
|
27
|
+
/**
|
|
28
|
+
* Wraps the user's `onSubmit` to:
|
|
29
|
+
* - run inside the OpenTelemetry span passed via `meta.currentSpan`
|
|
30
|
+
* - decode the raw form `value` (validators only validate, they don't transform)
|
|
31
|
+
* - normalize Promise / Effect / Fiber return values to a Promise
|
|
32
|
+
*
|
|
33
|
+
* Returns `undefined` when `userOnSubmit` is `undefined` (so callers can pass it
|
|
34
|
+
* directly to `useForm({ onSubmit })` without changing semantics).
|
|
35
|
+
*/
|
|
36
|
+
export declare const wrapOnSubmit: <From, To>(userOnSubmit: UserOnSubmit<From, To> | undefined, decode: (value: From) => Effect.Effect<To, any>, runPromise: RunPromise) => (({ formApi, meta, value }: {
|
|
37
|
+
formApi: OmegaFormParams<From, To>;
|
|
38
|
+
meta: any;
|
|
39
|
+
value: From;
|
|
40
|
+
}) => any) | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Builds the public submit handlers from a `useForm`-returned `form`:
|
|
43
|
+
* - `handleSubmit` injects the current OpenTelemetry span as `meta.currentSpan`.
|
|
44
|
+
* - `handleSubmitEffect` runs `handleSubmit` inside an Effect that picks up the
|
|
45
|
+
* ambient `Effect.currentSpan`. With `checkErrors: true`, it fails with
|
|
46
|
+
* `FormErrors<From>` when validation produced errors.
|
|
47
|
+
*/
|
|
48
|
+
export declare const makeSubmitHandlers: <From, To>(form: OmegaFormApi<From, To>) => {
|
|
49
|
+
handleSubmit: (meta?: Record<string, any>) => Promise<void>;
|
|
50
|
+
handleSubmitEffect: {
|
|
51
|
+
(options: {
|
|
52
|
+
checkErrors: true;
|
|
53
|
+
meta?: Record<string, any>;
|
|
54
|
+
}): Effect.Effect<void, FormErrors<From>>;
|
|
55
|
+
(options?: {
|
|
56
|
+
meta?: Record<string, any>;
|
|
57
|
+
}): Effect.Effect<void>;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import type { DeepKeys, DeepValue, FieldApi, FieldAsyncValidateOrFn, FieldState, FieldValidateOrFn, FormApi, FormAsyncValidateOrFn, FormOptions, FormState, FormValidateOrFn, StandardSchemaV1, VueFormApi } from "@tanstack/vue-form";
|
|
2
|
+
import type * as Effect from "effect-app/Effect";
|
|
3
|
+
import type * as S from "effect-app/Schema";
|
|
4
|
+
import type { UnionToTuples } from "effect-app/utils";
|
|
5
|
+
import type { Fiber as EffectFiber } from "effect/Fiber";
|
|
6
|
+
import type * as Order from "effect/Order";
|
|
7
|
+
import type { Redacted } from "effect/Redacted";
|
|
8
|
+
import type { AllowedComponentProps, Component, ComponentCustomProps, ComputedRef, PublicProps, ShallowUnwrapRef, VNode, VNodeProps } from "vue";
|
|
9
|
+
import type { MergedInputProps, OmegaFieldInternalApi, TaggedUnionOptionsArray } from "./InputProps";
|
|
10
|
+
import type { MetaRecord, NestedKeyOf } from "./meta/types";
|
|
11
|
+
import type { defaultValuesPriorityUnion as PersistencyPriority, Policies as PersistencyPolicies } from "./persistency";
|
|
12
|
+
import type { FormErrors } from "./submit";
|
|
13
|
+
export type FieldPath<T> = unknown extends T ? string : T extends string | boolean | number | null | undefined | symbol | bigint | Redacted<any> ? "" : T extends ReadonlyArray<infer U> ? FieldPath_<U, `[${number}]`> : {
|
|
14
|
+
[K in keyof T]: FieldPath_<T[K], K & string>;
|
|
15
|
+
}[keyof T];
|
|
16
|
+
export type FieldPath_<T, Path extends string> = unknown extends T ? string : T extends string | boolean | number | null | undefined | symbol | bigint | Redacted<any> ? Path : T extends ReadonlyArray<infer U> ? FieldPath_<U, `${Path}[${number}]`> | Path : {
|
|
17
|
+
[K in keyof T]: FieldPath_<T[K], `${Path}.${K & string}`>;
|
|
18
|
+
}[keyof T];
|
|
19
|
+
export type BaseProps<From, TName extends FieldPath<From>> = {
|
|
20
|
+
/**
|
|
21
|
+
* Will fallback to i18n when not specified.
|
|
22
|
+
* Can also be provided via #label slot for custom HTML labels.
|
|
23
|
+
* When using the slot, it receives bindings: { required, id, label }
|
|
24
|
+
*/
|
|
25
|
+
label?: string;
|
|
26
|
+
validators?: FieldValidators<From>;
|
|
27
|
+
/**
|
|
28
|
+
* Overrides the schema-derived `meta.required`.
|
|
29
|
+
* When omitted, requiredness is inferred from the schema.
|
|
30
|
+
*/
|
|
31
|
+
required?: boolean;
|
|
32
|
+
name: TName;
|
|
33
|
+
/**
|
|
34
|
+
* Optional class to apply to the input element.
|
|
35
|
+
* - If a string is provided, it will be used instead of the general class
|
|
36
|
+
* - If null is provided, no class will be applied (neither inputClass nor general class)
|
|
37
|
+
* - If undefined (not provided), the general class will be used
|
|
38
|
+
*/
|
|
39
|
+
inputClass?: string | null;
|
|
40
|
+
};
|
|
41
|
+
export type TypesWithOptions = "radio" | "select" | "multiple" | "autocomplete" | "autocompletemultiple";
|
|
42
|
+
export type DefaultTypeProps = {
|
|
43
|
+
type?: TypeOverride;
|
|
44
|
+
options?: undefined;
|
|
45
|
+
} | {
|
|
46
|
+
type?: TypesWithOptions;
|
|
47
|
+
options?: {
|
|
48
|
+
title: string;
|
|
49
|
+
value: unknown;
|
|
50
|
+
}[];
|
|
51
|
+
};
|
|
52
|
+
/** Registered `omegaConfig.inputs` keys as valid `type` values; `never` when nothing is registered. */
|
|
53
|
+
export type CustomTypeProps<TInputs> = string extends keyof TInputs ? never : keyof TInputs extends never ? never : {
|
|
54
|
+
type: keyof TInputs & string;
|
|
55
|
+
options?: {
|
|
56
|
+
title: string;
|
|
57
|
+
value: unknown;
|
|
58
|
+
}[];
|
|
59
|
+
};
|
|
60
|
+
/** `form.Input` `type`/`options`: built-ins plus types registered via `omegaConfig.inputs`. */
|
|
61
|
+
export type TypePropsFor<TInputs> = DefaultTypeProps | CustomTypeProps<TInputs>;
|
|
62
|
+
export type OmegaInputPropsBase<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, Name extends DeepKeys<From>> = {
|
|
63
|
+
form: OF<From, To> & {
|
|
64
|
+
meta: MetaRecord<From>;
|
|
65
|
+
i18nNamespace?: string;
|
|
66
|
+
};
|
|
67
|
+
} & BaseProps<From, Name> & DefaultTypeProps;
|
|
68
|
+
export type OmegaInputProps<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, Name extends DeepKeys<From>, TypeProps = DefaultTypeProps> = {
|
|
69
|
+
form: OmegaFormReturn<From, To, TypeProps> & {
|
|
70
|
+
meta: MetaRecord<From>;
|
|
71
|
+
i18nNamespace?: string;
|
|
72
|
+
};
|
|
73
|
+
} & BaseProps<From, Name>;
|
|
74
|
+
export type OmegaArrayProps<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, Name extends DeepKeys<From>> = Omit<OmegaInputProps<From, To, Name>, "validators" | "options" | "label" | "type" | "items" | "name"> & {
|
|
75
|
+
name: DeepKeys<From>;
|
|
76
|
+
defaultItems?: DeepValue<From, DeepKeys<From>>;
|
|
77
|
+
items?: "please use `defaultItems` instead";
|
|
78
|
+
};
|
|
79
|
+
export declare const typeOverrides: readonly ["string", "text", "number", "select", "multiple", "boolean", "radio", "autocomplete", "autocompletemultiple", "switch", "range", "password", "email", "date", "tel", "url", "color", "time", "search"];
|
|
80
|
+
export type TypeOverride = typeof typeOverrides[number];
|
|
81
|
+
export interface OmegaError {
|
|
82
|
+
label: string;
|
|
83
|
+
inputId: string;
|
|
84
|
+
errors: readonly string[];
|
|
85
|
+
}
|
|
86
|
+
export type FormProps<From, To> = Omit<FormOptions<From, FormValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, StandardSchemaV1<From, To>, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, Record<string, any> | undefined>, "onSubmit" | "defaultValues"> & {
|
|
87
|
+
defaultValues?: Partial<From>;
|
|
88
|
+
onSubmit?: (props: {
|
|
89
|
+
formApi: OmegaFormParams<From, To>;
|
|
90
|
+
meta: any;
|
|
91
|
+
value: To;
|
|
92
|
+
}) => Promise<any> | EffectFiber<any, any> | Effect.Effect<unknown, any>;
|
|
93
|
+
};
|
|
94
|
+
export type OmegaFormParams<From, To> = FormApi<From, FormValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, StandardSchemaV1<From, To>, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, Record<string, any> | undefined>;
|
|
95
|
+
export type OmegaFormState<From, To> = FormState<From, FormValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, StandardSchemaV1<From, To>, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined>;
|
|
96
|
+
export type OmegaFormApi<From, To, TSubmitMeta = Record<string, any> | undefined> = OmegaFormParams<From, To> & VueFormApi<From, FormValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, StandardSchemaV1<From, To>, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, TSubmitMeta>;
|
|
97
|
+
export type FormComponent<T, S> = VueFormApi<T, FormValidateOrFn<T> | undefined, FormValidateOrFn<T> | undefined, StandardSchemaV1<T, S>, FormValidateOrFn<T> | undefined, FormAsyncValidateOrFn<T> | undefined, FormValidateOrFn<T> | undefined, FormAsyncValidateOrFn<T> | undefined, FormValidateOrFn<T> | undefined, FormAsyncValidateOrFn<T> | undefined, FormAsyncValidateOrFn<T> | undefined, Record<string, any> | undefined>;
|
|
98
|
+
export type FormType<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, Name extends DeepKeys<From>> = OmegaFormApi<From, To> & {
|
|
99
|
+
Field: OmegaFieldInternalApi<From, Name>;
|
|
100
|
+
};
|
|
101
|
+
export type PrefixFromDepth<K extends string | number, _TDepth extends any[]> = K;
|
|
102
|
+
export type FieldValidators<T> = {
|
|
103
|
+
onChangeAsync?: FieldAsyncValidateOrFn<T, any, any>;
|
|
104
|
+
onChange?: FieldValidateOrFn<T, any, any>;
|
|
105
|
+
onBlur?: FieldValidateOrFn<T, any, any>;
|
|
106
|
+
onBlurAsync?: FieldAsyncValidateOrFn<T, any, any>;
|
|
107
|
+
};
|
|
108
|
+
export type OmegaAutoGenMeta<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, Name extends DeepKeys<From>> = Omit<OmegaInputProps<From, To, Name>, "form">;
|
|
109
|
+
type keysRule<T> = {
|
|
110
|
+
keys?: NestedKeyOf<T>[];
|
|
111
|
+
banKeys?: "You should only use one of banKeys or keys, not both, moron";
|
|
112
|
+
} | {
|
|
113
|
+
keys?: "You should only use one of banKeys or keys, not both, moron";
|
|
114
|
+
banKeys?: NestedKeyOf<T>[];
|
|
115
|
+
};
|
|
116
|
+
export type Policies = PersistencyPolicies;
|
|
117
|
+
export type defaultValuesPriorityUnion = PersistencyPriority;
|
|
118
|
+
export type OmegaConfig<T> = {
|
|
119
|
+
i18nNamespace?: string;
|
|
120
|
+
persistency?: {
|
|
121
|
+
/** Order of importance:
|
|
122
|
+
* - "querystring": Highest priority when persisting
|
|
123
|
+
* - "local" and then "session": Lower priority storage options
|
|
124
|
+
*/
|
|
125
|
+
policies?: UnionToTuples<Policies>;
|
|
126
|
+
overrideDefaultValues?: "deprecated: use defaultValuesPriority";
|
|
127
|
+
id?: string;
|
|
128
|
+
} & keysRule<T>;
|
|
129
|
+
ignorePreventCloseEvents?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Prevents browser window/tab exit when form has unsaved changes.
|
|
132
|
+
* Shows native browser "Leave site?" dialog.
|
|
133
|
+
*
|
|
134
|
+
* @remarks
|
|
135
|
+
* - Opt-in only: Must explicitly enable
|
|
136
|
+
* - Independent from data persistence feature
|
|
137
|
+
*/
|
|
138
|
+
preventWindowExit?: "prevent" | "prevent-and-reset" | "nope";
|
|
139
|
+
input?: any;
|
|
140
|
+
/**
|
|
141
|
+
* Register a custom input component per `type` (new types or overrides). Each
|
|
142
|
+
* key becomes a valid `<form.Input type="...">` value; components receive the
|
|
143
|
+
* `OmegaRendererProps` contract (`{ inputProps, field, state }`).
|
|
144
|
+
*/
|
|
145
|
+
inputs?: Record<string, Component>;
|
|
146
|
+
/**
|
|
147
|
+
* Default values order is: Tanstack default values passed as second parameter to useOmegaForm, then persistency
|
|
148
|
+
* default values from querystring or local/session storage, then defaults from schema
|
|
149
|
+
* You can customize the order and with omegaConfig.defaultValuesPriority
|
|
150
|
+
* default value = ['tanstack', 'persistency', 'schema']
|
|
151
|
+
*/
|
|
152
|
+
defaultValuesPriority?: UnionToTuples<defaultValuesPriorityUnion>;
|
|
153
|
+
defaultFromSchema?: "deprecated: use defaultValuesPriority";
|
|
154
|
+
};
|
|
155
|
+
export interface OF<From, To> extends OmegaFormApi<From, To> {
|
|
156
|
+
meta: MetaRecord<From>;
|
|
157
|
+
unionMeta: Record<string, MetaRecord<From>>;
|
|
158
|
+
inputs?: Record<string, Component>;
|
|
159
|
+
clear: () => void;
|
|
160
|
+
/**
|
|
161
|
+
* Backfills the untouched children of any materialised nullable struct with
|
|
162
|
+
* their schema default (or `null`), so the live `values` matches what
|
|
163
|
+
* validation and decoding see. Called after a field change.
|
|
164
|
+
*/
|
|
165
|
+
normalizeNullableStructs: () => void;
|
|
166
|
+
i18nNamespace?: string;
|
|
167
|
+
ignorePreventCloseEvents?: boolean;
|
|
168
|
+
registerField: (field: ComputedRef<{
|
|
169
|
+
name: string;
|
|
170
|
+
label: string;
|
|
171
|
+
id: string;
|
|
172
|
+
}>) => void;
|
|
173
|
+
/** @experimental */
|
|
174
|
+
handleSubmitEffect: {
|
|
175
|
+
/**
|
|
176
|
+
* when `checkErrors` is true, the Effect will fail with `FormErrors<From>` when there are validation errors
|
|
177
|
+
* @experimental */
|
|
178
|
+
(options: {
|
|
179
|
+
checkErrors: true;
|
|
180
|
+
meta?: Record<string, any>;
|
|
181
|
+
}): Effect.Effect<void, FormErrors<From>>;
|
|
182
|
+
/** @experimental */
|
|
183
|
+
(options?: {
|
|
184
|
+
meta?: Record<string, any>;
|
|
185
|
+
}): Effect.Effect<void>;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
type __VLS_PrettifyLocal<T> = {
|
|
189
|
+
[K in keyof T]: T[K];
|
|
190
|
+
} & {};
|
|
191
|
+
type CachedFieldApi<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, TypeProps = DefaultTypeProps> = FieldApi<From, OmegaFormReturn<From, To, TypeProps>["_keys"], DeepValue<From, OmegaFormReturn<From, To, TypeProps>["_keys"]>, FieldValidateOrFn<From, OmegaFormReturn<From, To, TypeProps>["_keys"], DeepValue<From, OmegaFormReturn<From, To, TypeProps>["_keys"]>> | undefined, FieldValidateOrFn<From, OmegaFormReturn<From, To, TypeProps>["_keys"], DeepValue<From, OmegaFormReturn<From, To, TypeProps>["_keys"]>> | undefined, FieldAsyncValidateOrFn<From, OmegaFormReturn<From, To, TypeProps>["_keys"], DeepValue<From, OmegaFormReturn<From, To, TypeProps>["_keys"]>> | undefined, FieldValidateOrFn<From, OmegaFormReturn<From, To, TypeProps>["_keys"], DeepValue<From, OmegaFormReturn<From, To, TypeProps>["_keys"]>> | undefined, FieldAsyncValidateOrFn<From, OmegaFormReturn<From, To, TypeProps>["_keys"], DeepValue<From, OmegaFormReturn<From, To, TypeProps>["_keys"]>> | undefined, FieldValidateOrFn<From, OmegaFormReturn<From, To, TypeProps>["_keys"], DeepValue<From, OmegaFormReturn<From, To, TypeProps>["_keys"]>> | undefined, FieldAsyncValidateOrFn<From, OmegaFormReturn<From, To, TypeProps>["_keys"], DeepValue<From, OmegaFormReturn<From, To, TypeProps>["_keys"]>> | undefined, FieldValidateOrFn<From, OmegaFormReturn<From, To, TypeProps>["_keys"], DeepValue<From, OmegaFormReturn<From, To, TypeProps>["_keys"]>> | undefined, FieldAsyncValidateOrFn<From, OmegaFormReturn<From, To, TypeProps>["_keys"], DeepValue<From, OmegaFormReturn<From, To, TypeProps>["_keys"]>> | undefined, FormValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, StandardSchemaV1<From, To>, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, Record<string, any> | undefined>;
|
|
192
|
+
type CachedFieldState<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, TypeProps = DefaultTypeProps> = FieldState<From, OmegaFormReturn<From, To, TypeProps>["_keys"], DeepValue<From, OmegaFormReturn<From, To, TypeProps>["_keys"]>, FieldValidateOrFn<From, OmegaFormReturn<From, To, TypeProps>["_keys"], DeepValue<From, OmegaFormReturn<From, To, TypeProps>["_keys"]>> | undefined, FieldValidateOrFn<From, OmegaFormReturn<From, To, TypeProps>["_keys"], DeepValue<From, OmegaFormReturn<From, To, TypeProps>["_keys"]>> | undefined, FieldAsyncValidateOrFn<From, OmegaFormReturn<From, To, TypeProps>["_keys"], DeepValue<From, OmegaFormReturn<From, To, TypeProps>["_keys"]>> | undefined, FieldValidateOrFn<From, OmegaFormReturn<From, To, TypeProps>["_keys"], DeepValue<From, OmegaFormReturn<From, To, TypeProps>["_keys"]>> | undefined, FieldAsyncValidateOrFn<From, OmegaFormReturn<From, To, TypeProps>["_keys"], DeepValue<From, OmegaFormReturn<From, To, TypeProps>["_keys"]>> | undefined, FieldValidateOrFn<From, OmegaFormReturn<From, To, TypeProps>["_keys"], DeepValue<From, OmegaFormReturn<From, To, TypeProps>["_keys"]>> | undefined, FieldAsyncValidateOrFn<From, OmegaFormReturn<From, To, TypeProps>["_keys"], DeepValue<From, OmegaFormReturn<From, To, TypeProps>["_keys"]>> | undefined, FieldValidateOrFn<From, OmegaFormReturn<From, To, TypeProps>["_keys"], DeepValue<From, OmegaFormReturn<From, To, TypeProps>["_keys"]>> | undefined, FieldAsyncValidateOrFn<From, OmegaFormReturn<From, To, TypeProps>["_keys"], DeepValue<From, OmegaFormReturn<From, To, TypeProps>["_keys"]>> | undefined, FormValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, StandardSchemaV1<From, To>, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined>;
|
|
193
|
+
export interface OmegaFormReturn<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, TypeProps = DefaultTypeProps> extends OF<From, To> {
|
|
194
|
+
_paths: FieldPath<From>;
|
|
195
|
+
_keys: NestedKeyOf<From>;
|
|
196
|
+
_schema: S.Codec<To, From>;
|
|
197
|
+
Input: <Name extends OmegaFormReturn<From, To, TypeProps>["_paths"]>(__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<{
|
|
198
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & TypeProps & Partial<{}>> & BaseProps<From, Name> & PublicProps;
|
|
199
|
+
expose(exposed: ShallowUnwrapRef<{}>): void;
|
|
200
|
+
attrs: any;
|
|
201
|
+
slots: {
|
|
202
|
+
default?(props: MergedInputProps<From, Name>): void;
|
|
203
|
+
label?: (props: {
|
|
204
|
+
required: boolean;
|
|
205
|
+
id: string;
|
|
206
|
+
label: string;
|
|
207
|
+
}) => void;
|
|
208
|
+
};
|
|
209
|
+
emit: {};
|
|
210
|
+
}>) => VNode & {
|
|
211
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
212
|
+
};
|
|
213
|
+
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<{
|
|
214
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & Partial<{}>> & PublicProps;
|
|
215
|
+
expose(exposed: ShallowUnwrapRef<{}>): void;
|
|
216
|
+
attrs: any;
|
|
217
|
+
slots: {
|
|
218
|
+
default: (props: {
|
|
219
|
+
errors: readonly OmegaError[];
|
|
220
|
+
showedGeneralErrors: string[];
|
|
221
|
+
}) => void;
|
|
222
|
+
};
|
|
223
|
+
emit: {};
|
|
224
|
+
}>) => VNode & {
|
|
225
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
226
|
+
};
|
|
227
|
+
TaggedUnion: <Name extends OmegaFormReturn<From, To, TypeProps>["_keys"]>(__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<{
|
|
228
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & {
|
|
229
|
+
name?: Name;
|
|
230
|
+
type?: "select" | "radio";
|
|
231
|
+
options: TaggedUnionOptionsArray<From, Name>;
|
|
232
|
+
_debugName?: [NoInfer<Name>];
|
|
233
|
+
label?: string;
|
|
234
|
+
} & {}> & PublicProps;
|
|
235
|
+
expose(exposed: ShallowUnwrapRef<{}>): void;
|
|
236
|
+
attrs: any;
|
|
237
|
+
slots: Record<string, (props: {
|
|
238
|
+
field: 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>;
|
|
239
|
+
state: FieldState<From, Name, DeepValue<From, Name>, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
|
|
240
|
+
}) => any>;
|
|
241
|
+
emit: {};
|
|
242
|
+
}>) => VNode & {
|
|
243
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
244
|
+
};
|
|
245
|
+
Array: <Name extends OmegaFormReturn<From, To, TypeProps>["_keys"]>(__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<{
|
|
246
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & (Omit<OmegaArrayProps<From, To, Name>, "form">) & {}> & PublicProps;
|
|
247
|
+
expose(exposed: ShallowUnwrapRef<{}>): void;
|
|
248
|
+
attrs: any;
|
|
249
|
+
slots: {
|
|
250
|
+
"pre-array"?: (props: {
|
|
251
|
+
field: CachedFieldApi<From, To, TypeProps>;
|
|
252
|
+
state: CachedFieldState<From, To, TypeProps>;
|
|
253
|
+
}) => any;
|
|
254
|
+
} & {
|
|
255
|
+
default?: (props: {
|
|
256
|
+
subField: CachedFieldApi<From, To, TypeProps>;
|
|
257
|
+
subState: CachedFieldState<From, To, TypeProps>;
|
|
258
|
+
index: number;
|
|
259
|
+
field: CachedFieldApi<From, To, TypeProps>;
|
|
260
|
+
}) => any;
|
|
261
|
+
} & {
|
|
262
|
+
"post-array"?: (props: {
|
|
263
|
+
field: CachedFieldApi<From, To, TypeProps>;
|
|
264
|
+
state: CachedFieldState<From, To, TypeProps>;
|
|
265
|
+
}) => any;
|
|
266
|
+
} & {
|
|
267
|
+
field?: (props: {
|
|
268
|
+
field: CachedFieldApi<From, To, TypeProps>;
|
|
269
|
+
}) => any;
|
|
270
|
+
};
|
|
271
|
+
emit: {};
|
|
272
|
+
}>) => VNode & {
|
|
273
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
274
|
+
};
|
|
275
|
+
AutoGen: <Name extends OmegaFormReturn<From, To, TypeProps>["_keys"]>(__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<{
|
|
276
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & {
|
|
277
|
+
pick?: OmegaFormReturn<From, To, TypeProps>["_keys"][];
|
|
278
|
+
omit?: OmegaFormReturn<From, To, TypeProps>["_keys"][];
|
|
279
|
+
labelMap?: (key: OmegaFormReturn<From, To, TypeProps>["_keys"]) => string | undefined;
|
|
280
|
+
filterMap?: <M extends OmegaAutoGenMeta<From, To, Name>>(key: OmegaFormReturn<From, To, TypeProps>["_keys"], meta: M) => boolean | M;
|
|
281
|
+
order?: OmegaFormReturn<From, To, TypeProps>["_keys"][];
|
|
282
|
+
sort?: Order.Order<OmegaAutoGenMeta<From, To, Name>>;
|
|
283
|
+
} & {}> & PublicProps;
|
|
284
|
+
expose(exposed: ShallowUnwrapRef<{}>): void;
|
|
285
|
+
attrs: any;
|
|
286
|
+
slots: {
|
|
287
|
+
default(props: {
|
|
288
|
+
child: OmegaAutoGenMeta<From, To, Name>;
|
|
289
|
+
}): void;
|
|
290
|
+
};
|
|
291
|
+
emit: {};
|
|
292
|
+
}>) => VNode & {
|
|
293
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
294
|
+
};
|
|
295
|
+
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<{
|
|
296
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & {
|
|
297
|
+
disabled?: boolean;
|
|
298
|
+
subscribe?: K[];
|
|
299
|
+
} & {}> & PublicProps;
|
|
300
|
+
expose(exposed: ShallowUnwrapRef<{}>): void;
|
|
301
|
+
attrs: any;
|
|
302
|
+
slots: {
|
|
303
|
+
default(props: {
|
|
304
|
+
subscribedValues: K[] extends undefined[] ? Record<string, never> : Pick<OmegaFormState<From, To>, K>;
|
|
305
|
+
}): void;
|
|
306
|
+
};
|
|
307
|
+
emit: {};
|
|
308
|
+
}>) => VNode & {
|
|
309
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
export {};
|