@bysages/svelte 0.4.1 → 0.4.2

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.
Files changed (162) hide show
  1. package/dist/{Accordion-BkqRwmjT.mjs → Accordion-DF1vzXDg.mjs} +1 -1
  2. package/dist/Calendar-CWaU4MGJ.mjs +589 -0
  3. package/dist/{Carousel-D-v0Bza0.mjs → Carousel-BWWwu5Ma.mjs} +1 -1
  4. package/dist/{Checkbox-Dt_QeNLA.mjs → Checkbox-BZb8IR25.mjs} +1 -1
  5. package/dist/{ChevronIcon-BrLZJ0NH.mjs → ChevronIcon-C-MKLsfA.mjs} +1 -1
  6. package/dist/{Clipboard-BHy1YrlL.mjs → Clipboard-DBgbIGjV.mjs} +1 -1
  7. package/dist/{Collapsible-DKTSOxEd.mjs → Collapsible-CZ8qFLzP.mjs} +1 -1
  8. package/dist/{ColorPicker-DK1jZSSj.mjs → ColorPicker-D6PGvfQf.mjs} +1 -1
  9. package/dist/{Combobox-BNzikc6h.mjs → Combobox-Ba2u_SqJ.mjs} +1 -1
  10. package/dist/{DatePicker-BGt2KYR_.mjs → DatePicker-Dm81GmmF.mjs} +1 -1
  11. package/dist/{descriptions-DGuEJmgX.mjs → Descriptions-C1qZ05Ph.mjs} +2 -13
  12. package/dist/{Dialog-C_fbKqoA.mjs → Dialog-BbDr030S.mjs} +1 -1
  13. package/dist/{Drawer-DOOnBSMq.mjs → Drawer-C1r1wz3V.mjs} +1 -1
  14. package/dist/{Editable-Btl-QYDY.mjs → Editable-hjSbhWMK.mjs} +1 -1
  15. package/dist/{FileUpload-DHZf3u4d.mjs → FileUpload-C6JBpvet.mjs} +1 -1
  16. package/dist/{FloatingPanel-CkWYZ4MO.mjs → FloatingPanel-2z-iuVPc.mjs} +1 -1
  17. package/dist/{ImageViewer-CuTn5ho6.mjs → ImageViewer-8tDJvkkb.mjs} +1 -1
  18. package/dist/{InternalIcon-Clwbj4MY.mjs → InternalIcon-CbfKieOs.mjs} +1 -1
  19. package/dist/{JsonTreeViewTree-IqoSdRQR.mjs → JsonTreeViewTree-DkusAr3j.mjs} +1 -1
  20. package/dist/{Listbox-BQTnipRA.mjs → Listbox-gAL5Q59b.mjs} +1 -1
  21. package/dist/{Menu-CxPWabm-.mjs → Menu-BiwHDpdz.mjs} +1 -1
  22. package/dist/{NumberInput-FqS47j4x.mjs → NumberInput-B2gPYuJX.mjs} +1 -1
  23. package/dist/Pagination-f8XiX-Cs.mjs +210 -0
  24. package/dist/{PasswordInput-DxtreG-T.mjs → PasswordInput-BhlJF3Jd.mjs} +1 -1
  25. package/dist/{Popover-C2oWItCV.mjs → Popover-Dl-QAFG_.mjs} +1 -1
  26. package/dist/Progress-Byx2qRcT.mjs +191 -0
  27. package/dist/{RatingGroup-Btui4It7.mjs → RatingGroup-DTVzY6BA.mjs} +1 -1
  28. package/dist/{Select-Dv0dqYII.mjs → Select-5AJHEmMi.mjs} +1 -1
  29. package/dist/{StepsItem-BrDhhxjY.mjs → StepsItem-KwQ6SrNR.mjs} +46 -27
  30. package/dist/{Swap-DSxNn2gk.mjs → Swap-CfgxrCzJ.mjs} +1 -1
  31. package/dist/{TagsInput-Bz_NUGXo.mjs → TagsInput-DVuAOpBt.mjs} +1 -1
  32. package/dist/{Toast-B15KZZH0.mjs → Toast-BHSRo7N7.mjs} +1 -1
  33. package/dist/{ToggleGroup-NRzTANnd.mjs → ToggleGroup-DgBoC0hi.mjs} +1 -1
  34. package/dist/{TreeViewNodeCheckbox-l1l6EYyz.mjs → TreeViewNodeCheckbox-DGfG5yIl.mjs} +1 -1
  35. package/dist/{ai-attachments-BuH2tjOv.mjs → ai-attachments-nFUAAXoM.mjs} +1 -1
  36. package/dist/{ai-prompt-input-CV683FB3.mjs → ai-prompt-input-z0j3gpgu.mjs} +59 -54
  37. package/dist/{ai-reasoning-CesP6H0y.mjs → ai-reasoning-C2Ffu52i.mjs} +1 -1
  38. package/dist/{ai-response-Bu-iNsC-.mjs → ai-response-Bczv0TaC.mjs} +1 -1
  39. package/dist/{ai-tool-pBb7sCz2.mjs → ai-tool-DuhNqTWQ.mjs} +1 -1
  40. package/dist/{alert-ClMd57tZ.mjs → alert-Cji6_TKm.mjs} +1 -1
  41. package/dist/{back-top-CJXLTyyZ.mjs → back-top-WBPZ45WG.mjs} +1 -1
  42. package/dist/{banner-fF1_G7qu.mjs → banner-vdEHwWWw.mjs} +1 -1
  43. package/dist/{cascade-select-C4OSlWpx.mjs → cascade-select-CWjvNB4G.mjs} +1 -1
  44. package/dist/{checkbox-group-CZSQvm6H.mjs → checkbox-group-JVSnrwhR.mjs} +1 -1
  45. package/dist/components/accordion/index.d.mts +1 -1
  46. package/dist/components/accordion/index.mjs +1 -1
  47. package/dist/components/ai/index.mjs +4 -4
  48. package/dist/components/ai-attachments/index.mjs +1 -1
  49. package/dist/components/ai-prompt-input/index.mjs +1 -1
  50. package/dist/components/ai-reasoning/index.mjs +1 -1
  51. package/dist/components/ai-response/index.mjs +1 -1
  52. package/dist/components/ai-tool/index.mjs +1 -1
  53. package/dist/components/alert/index.mjs +1 -1
  54. package/dist/components/back-top/index.mjs +1 -1
  55. package/dist/components/banner/index.mjs +1 -1
  56. package/dist/components/calendar/index.d.mts +1 -1
  57. package/dist/components/calendar/index.mjs +9 -1
  58. package/dist/components/carousel/index.d.mts +1 -1
  59. package/dist/components/carousel/index.mjs +1 -1
  60. package/dist/components/cascade-select/index.mjs +1 -1
  61. package/dist/components/checkbox/index.d.mts +1 -1
  62. package/dist/components/checkbox/index.mjs +1 -1
  63. package/dist/components/checkbox-group/index.mjs +1 -1
  64. package/dist/components/chip/index.d.mts +1 -1
  65. package/dist/components/clipboard/index.d.mts +1 -1
  66. package/dist/components/clipboard/index.mjs +1 -1
  67. package/dist/components/collapsible/index.d.mts +1 -1
  68. package/dist/components/collapsible/index.mjs +1 -1
  69. package/dist/components/color-picker/index.d.mts +1 -1
  70. package/dist/components/color-picker/index.mjs +1 -1
  71. package/dist/components/combobox/index.d.mts +1 -1
  72. package/dist/components/combobox/index.mjs +1 -1
  73. package/dist/components/date-picker/index.d.mts +1 -1
  74. package/dist/components/date-picker/index.mjs +1 -1
  75. package/dist/components/descriptions/index.d.mts +1 -1
  76. package/dist/components/descriptions/index.mjs +13 -1
  77. package/dist/components/dialog/index.d.mts +1 -1
  78. package/dist/components/dialog/index.mjs +1 -1
  79. package/dist/components/drawer/index.d.mts +1 -1
  80. package/dist/components/drawer/index.mjs +1 -1
  81. package/dist/components/dynamic-input/index.mjs +1 -1
  82. package/dist/components/editable/index.d.mts +1 -1
  83. package/dist/components/editable/index.mjs +1 -1
  84. package/dist/components/file-upload/index.d.mts +1 -1
  85. package/dist/components/file-upload/index.mjs +1 -1
  86. package/dist/components/floating-panel/index.d.mts +1 -1
  87. package/dist/components/floating-panel/index.mjs +1 -1
  88. package/dist/components/form/index.d.mts +1 -1
  89. package/dist/components/image/index.mjs +1 -1
  90. package/dist/components/image-viewer/index.d.mts +1 -1
  91. package/dist/components/image-viewer/index.mjs +1 -1
  92. package/dist/components/json-tree-view/index.d.mts +1 -1
  93. package/dist/components/json-tree-view/index.mjs +1 -1
  94. package/dist/components/listbox/index.d.mts +1 -1
  95. package/dist/components/listbox/index.mjs +1 -1
  96. package/dist/components/media-player/index.mjs +1 -1
  97. package/dist/components/menu/index.d.mts +1 -1
  98. package/dist/components/menu/index.mjs +1 -1
  99. package/dist/components/number-input/index.d.mts +1 -1
  100. package/dist/components/number-input/index.mjs +1 -1
  101. package/dist/components/order-list/index.mjs +1 -1
  102. package/dist/components/pagination/index.d.mts +1 -1
  103. package/dist/components/pagination/index.mjs +1 -1
  104. package/dist/components/password-input/index.d.mts +1 -1
  105. package/dist/components/password-input/index.mjs +1 -1
  106. package/dist/components/popover/index.d.mts +1 -1
  107. package/dist/components/popover/index.mjs +1 -1
  108. package/dist/components/progress/index.d.mts +1 -1
  109. package/dist/components/progress/index.mjs +1 -1
  110. package/dist/components/rating-group/index.d.mts +1 -1
  111. package/dist/components/rating-group/index.mjs +1 -1
  112. package/dist/components/select/index.d.mts +1 -1
  113. package/dist/components/select/index.mjs +1 -1
  114. package/dist/components/split-button/index.mjs +1 -1
  115. package/dist/components/steps/index.d.mts +1 -1
  116. package/dist/components/steps/index.mjs +1 -1
  117. package/dist/components/swap/index.d.mts +1 -1
  118. package/dist/components/swap/index.mjs +1 -1
  119. package/dist/components/table/index.d.mts +1 -1
  120. package/dist/components/table/index.mjs +1 -1
  121. package/dist/components/tag/index.d.mts +2 -0
  122. package/dist/components/tag/index.mjs +2 -0
  123. package/dist/components/tags-input/index.d.mts +1 -1
  124. package/dist/components/tags-input/index.mjs +1 -1
  125. package/dist/components/toast/index.d.mts +1 -1
  126. package/dist/components/toast/index.mjs +1 -1
  127. package/dist/components/toggle-group/index.d.mts +1 -1
  128. package/dist/components/toggle-group/index.mjs +1 -1
  129. package/dist/components/transfer/index.mjs +1 -1
  130. package/dist/components/tree-select/index.mjs +1 -1
  131. package/dist/components/tree-view/index.d.mts +1 -1
  132. package/dist/components/tree-view/index.mjs +1 -1
  133. package/dist/{dynamic-input-5H3wZSDs.mjs → dynamic-input-BDF0xRDd.mjs} +1 -1
  134. package/dist/{icon-lWVQxDG6.mjs → icon-C6ohnKuW.mjs} +4 -3
  135. package/dist/{image-ojKJgHcu.mjs → image-BCYdfhgr.mjs} +1 -1
  136. package/dist/{index-BfpbvgWG.d.mts → index-BDEuWWx7.d.mts} +1 -1
  137. package/dist/index-BEZCr62O.d.mts +34 -0
  138. package/dist/{index-Cbc4doAM.d.mts → index-BpC1s3zv.d.mts} +6 -10
  139. package/dist/{index-CGKWHB6A.d.mts → index-C4FVU8_3.d.mts} +1 -1
  140. package/dist/{index-DXXhfdQC.d.mts → index-CA0W58ZE.d.mts} +2 -0
  141. package/dist/{index-C785xRlX.d.mts → index-CFxAJ3UH.d.mts} +1 -1
  142. package/dist/index-DQL1l90b.d.mts +42 -0
  143. package/dist/{index-DXw6GBt8.d.mts → index-DTYHFIbh.d.mts} +1 -1
  144. package/dist/index-DkvQPyaW.d.mts +33 -0
  145. package/dist/{index-550dAp3p.d.mts → index-M2f9hz3z.d.mts} +1 -1
  146. package/dist/{index-COWyuYkn.d.mts → index-fIWQxtE9.d.mts} +1 -1
  147. package/dist/index.d.mts +12 -11
  148. package/dist/index.mjs +23 -22
  149. package/dist/{media-player-CfMaLa8v.mjs → media-player-085Q_gL8.mjs} +2 -2
  150. package/dist/{order-list-06iEy0em.mjs → order-list-DtAaQ6VS.mjs} +22 -1
  151. package/dist/{select-E3cvud0r.mjs → select-CqOZTmfR.mjs} +2 -2
  152. package/dist/{split-button-BIkQu0B7.mjs → split-button-18nv8J3q.mjs} +1 -1
  153. package/dist/{table-847YLjld.mjs → table-LfPEezF-.mjs} +6 -4
  154. package/dist/tag-S2DR-cEP.mjs +122 -0
  155. package/dist/{transfer-D4UANNwH.mjs → transfer-kGHh9bJH.mjs} +1 -1
  156. package/dist/{tree-select-CyjhG4ZB.mjs → tree-select-BRQjFrHA.mjs} +1 -1
  157. package/package.json +2 -2
  158. package/dist/Pagination-OpR284GX.mjs +0 -180
  159. package/dist/Progress-ZSXSq5na.mjs +0 -115
  160. package/dist/calendar-D251DqRb.mjs +0 -469
  161. package/dist/index-CMVb7mmq.d.mts +0 -1813
  162. package/dist/index-CuonhYXR.d.mts +0 -21
@@ -1,1813 +0,0 @@
1
- import { Component, Snippet } from "svelte";
2
- import { SvelteFormApi, createField, createField as useField, createForm, createForm as useForm } from "@tanstack/svelte-form";
3
- import { HTMLAttributes } from "svelte/elements";
4
- //#region src/components/form/context.d.ts
5
- /** The seam this family passes the engine through — the members the
6
- * components drive, with the engine's field-name generics opened to
7
- * `any`. The engine ships no "any form" alias: its loosest, `FormLikeAPI`,
8
- * still pins names to `string`, which a concrete form's literal names
9
- * cannot satisfy. */
10
- interface AnyFormApi$1 {
11
- handleSubmit(): Promise<unknown>;
12
- setFieldMeta(field: any, updater: (prev: any) => any): void;
13
- Field: Component;
14
- }
15
- //#endregion
16
- //#region src/components/form/props.d.ts
17
- interface FormProps extends HTMLAttributes<HTMLFormElement> {
18
- form: AnyFormApi$1;
19
- children?: Snippet;
20
- }
21
- interface FormFieldProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
22
- form?: AnyFormApi$1;
23
- name: string;
24
- label?: string;
25
- hint?: string;
26
- required?: boolean;
27
- invalid?: boolean;
28
- disabled?: boolean;
29
- children?: Snippet<[any]>;
30
- }
31
- //#endregion
32
- //#region ../../node_modules/.pnpm/@tanstack+form-core@1.33.5/node_modules/@tanstack/form-core/dist/esm/standardSchemaValidator.d.ts
33
- type TStandardSchemaValidatorValue<TData, TSource extends ValidationSource = ValidationSource> = {
34
- value: TData;
35
- validationSource: TSource;
36
- };
37
- /**
38
- * The Standard Schema interface.
39
- */
40
- type StandardSchemaV1<Input = unknown, Output = Input> = {
41
- /**
42
- * The Standard Schema properties.
43
- */
44
- readonly '~standard': StandardSchemaV1Props<Input, Output>;
45
- };
46
- /**
47
- * The Standard Schema properties interface.
48
- */
49
- interface StandardSchemaV1Props<Input = unknown, Output = Input> {
50
- /**
51
- * The version number of the standard.
52
- */
53
- readonly version: 1;
54
- /**
55
- * The vendor name of the schema library.
56
- */
57
- readonly vendor: string;
58
- /**
59
- * Validates unknown input values.
60
- */
61
- readonly validate: (value: unknown) => StandardSchemaV1Result<Output> | Promise<StandardSchemaV1Result<Output>>;
62
- /**
63
- * Inferred types associated with the schema.
64
- */
65
- readonly types?: StandardSchemaV1Types<Input, Output> | undefined;
66
- }
67
- /**
68
- * The result interface of the validate function.
69
- */
70
- type StandardSchemaV1Result<Output> = StandardSchemaV1SuccessResult<Output> | StandardSchemaV1FailureResult;
71
- /**
72
- * The result interface if validation succeeds.
73
- */
74
- interface StandardSchemaV1SuccessResult<Output> {
75
- /**
76
- * The typed output value.
77
- */
78
- readonly value: Output;
79
- /**
80
- * The non-existent issues.
81
- */
82
- readonly issues?: undefined;
83
- }
84
- /**
85
- * The result interface if validation fails.
86
- */
87
- interface StandardSchemaV1FailureResult {
88
- /**
89
- * The issues of failed validation.
90
- */
91
- readonly issues: ReadonlyArray<StandardSchemaV1Issue>;
92
- }
93
- /**
94
- * The issue interface of the failure output.
95
- */
96
- interface StandardSchemaV1Issue {
97
- /**
98
- * The error message of the issue.
99
- */
100
- readonly message: string;
101
- /**
102
- * The path of the issue, if any.
103
- */
104
- readonly path?: ReadonlyArray<PropertyKey | StandardSchemaV1PathSegment> | undefined;
105
- }
106
- /**
107
- * The path segment interface of the issue.
108
- */
109
- interface StandardSchemaV1PathSegment {
110
- /**
111
- * The key representing a path segment.
112
- */
113
- readonly key: PropertyKey;
114
- }
115
- /**
116
- * The Standard Schema types interface.
117
- */
118
- interface StandardSchemaV1Types<Input = unknown, Output = Input> {
119
- /**
120
- * The input type of the schema.
121
- */
122
- readonly input: Input;
123
- /**
124
- * The output type of the schema.
125
- */
126
- readonly output: Output;
127
- }
128
- //#endregion
129
- //#region ../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/types.d.ts
130
- type Observer<T> = {
131
- next?: (value: T) => void;
132
- error?: (err: unknown) => void;
133
- complete?: () => void;
134
- };
135
- interface Subscription {
136
- unsubscribe: () => void;
137
- }
138
- //#endregion
139
- //#region ../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/store.d.ts
140
- //#region src/store.d.ts
141
- type StoreAction = (...args: Array<any>) => any;
142
- type StoreActionMap = Record<string, StoreAction>;
143
- type StoreActionsFactory<T, TActions extends StoreActionMap> = (store: {
144
- setState: Store<T>['setState'];
145
- get: Store<T>['get'];
146
- }) => TActions;
147
- type NonFunction<T> = T extends ((...args: Array<any>) => any) ? never : T;
148
- declare class Store<T, TActions extends StoreActionMap = never> {
149
- private atom;
150
- readonly actions: TActions;
151
- constructor(getValue: (prev?: NoInfer<T>) => T);
152
- constructor(initialValue: T);
153
- constructor(initialValue: NonFunction<T>, actionsFactory: StoreActionsFactory<T, TActions>);
154
- setState(updater: (prev: T) => T): void;
155
- get state(): T;
156
- get(): T;
157
- subscribe(observerOrFn: Observer<T> | ((value: T) => void)): Subscription;
158
- }
159
- declare class ReadonlyStore<T> implements Omit<Store<T>, 'setState' | 'actions'> {
160
- private atom;
161
- constructor(getValue: (prev?: NoInfer<T>) => T);
162
- constructor(initialValue: T);
163
- get state(): T;
164
- get(): T;
165
- subscribe(observerOrFn: Observer<T> | ((value: T) => void)): Subscription;
166
- }
167
- //#endregion
168
- //#region ../../node_modules/.pnpm/@tanstack+form-core@1.33.5/node_modules/@tanstack/form-core/dist/esm/util-types.d.ts
169
- /**
170
- * @private
171
- */
172
- type UnwrapOneLevelOfArray<T> = T extends (infer U)[] ? U : T;
173
- /**
174
- * @private
175
- * Helper type that rejects synchronous validators that return Promises.
176
- * If the validator is a function returning a Promise, the type becomes `never`.
177
- * Uses infer to extract the return type and handles `any` specially to avoid
178
- * rejecting mock functions and other uses of `any`.
179
- */
180
- type RejectPromiseValidator<T> = T extends ((...args: any[]) => infer R) ? 0 extends 1 & R ? T : [R] extends [Promise<any> | PromiseLike<any>] ? never : T : T;
181
- interface AnyDeepKeyAndValue<K extends string = string, V extends any = any> {
182
- key: K;
183
- value: V;
184
- }
185
- type ArrayAccessor<TParent extends AnyDeepKeyAndValue> = `${TParent['key'] extends never ? '' : TParent['key']}[${number}]`;
186
- interface ArrayDeepKeyAndValue<in out TParent extends AnyDeepKeyAndValue, in out T extends ReadonlyArray<any>> extends AnyDeepKeyAndValue {
187
- key: ArrayAccessor<TParent>;
188
- value: T[number] | Nullable<TParent['value']>;
189
- }
190
- type DeepKeyAndValueArray<TParent extends AnyDeepKeyAndValue, T extends ReadonlyArray<any>, TAcc> = DeepKeysAndValuesImpl<NonNullable<T[number]>, ArrayDeepKeyAndValue<TParent, T>, TAcc | ArrayDeepKeyAndValue<TParent, T>>;
191
- type TupleAccessor<TParent extends AnyDeepKeyAndValue, TKey extends string> = `${TParent['key'] extends never ? '' : TParent['key']}[${TKey}]`;
192
- interface TupleDeepKeyAndValue<in out TParent extends AnyDeepKeyAndValue, in out T, in out TKey extends AllTupleKeys<T>> extends AnyDeepKeyAndValue {
193
- key: TupleAccessor<TParent, TKey>;
194
- value: T[TKey] | Nullable<TParent['value']>;
195
- }
196
- type AllTupleKeys<T> = T extends any ? keyof T & `${number}` : never;
197
- type DeepKeyAndValueTuple<TParent extends AnyDeepKeyAndValue, T extends ReadonlyArray<any>, TAcc, TAllKeys extends AllTupleKeys<T> = AllTupleKeys<T>> = TAllKeys extends any ? DeepKeysAndValuesImpl<NonNullable<T[TAllKeys]>, TupleDeepKeyAndValue<TParent, T, TAllKeys>, TAcc | TupleDeepKeyAndValue<TParent, T, TAllKeys>> : never;
198
- type AllObjectKeys<T> = T extends any ? keyof T & (string | number) : never;
199
- type ObjectAccessor<TParent extends AnyDeepKeyAndValue, TKey extends string | number> = TParent['key'] extends never ? `${TKey}` : `${TParent['key']}.${TKey}`;
200
- type Nullable<T> = T & (undefined | null);
201
- type ObjectValue<TParent extends AnyDeepKeyAndValue, T, TKey extends AllObjectKeys<T>> = T[TKey] | Nullable<TParent['value']>;
202
- interface ObjectDeepKeyAndValue<in out TParent extends AnyDeepKeyAndValue, in out T, in out TKey extends AllObjectKeys<T>> extends AnyDeepKeyAndValue {
203
- key: ObjectAccessor<TParent, TKey>;
204
- value: ObjectValue<TParent, T, TKey>;
205
- }
206
- type DeepKeyAndValueObject<TParent extends AnyDeepKeyAndValue, T, TAcc, TAllKeys extends AllObjectKeys<T> = AllObjectKeys<T>> = TAllKeys extends any ? DeepKeysAndValuesImpl<NonNullable<T[TAllKeys]>, ObjectDeepKeyAndValue<TParent, T, TAllKeys>, TAcc | ObjectDeepKeyAndValue<TParent, T, TAllKeys>> : never;
207
- type UnknownAccessor<TParent extends AnyDeepKeyAndValue> = TParent['key'] extends never ? string : `${TParent['key']}.${string}`;
208
- interface UnknownDeepKeyAndValue<TParent extends AnyDeepKeyAndValue> extends AnyDeepKeyAndValue {
209
- key: UnknownAccessor<TParent>;
210
- value: unknown;
211
- }
212
- type DeepKeysAndValues<T> = DeepKeysAndValuesImpl<T> extends AnyDeepKeyAndValue ? DeepKeysAndValuesImpl<T> : never;
213
- type DeepKeysAndValuesImpl<T, TParent extends AnyDeepKeyAndValue = never, TAcc = never> = unknown extends T ? TAcc | UnknownDeepKeyAndValue<TParent> : unknown extends T ? T : T extends string | number | boolean | bigint | Date ? TAcc : T extends ReadonlyArray<any> ? number extends T['length'] ? DeepKeyAndValueArray<TParent, T, TAcc> : DeepKeyAndValueTuple<TParent, T, TAcc> : keyof T extends never ? TAcc | UnknownDeepKeyAndValue<TParent> : T extends object ? DeepKeyAndValueObject<TParent, T, TAcc> : TAcc;
214
- type DeepRecord<T> = { [TRecord in DeepKeysAndValues<T> as TRecord['key']]: TRecord['value']; };
215
- /**
216
- * The keys of an object or array, deeply nested.
217
- */
218
- type DeepKeys<T> = unknown extends T ? string : DeepKeysAndValues<T>['key'];
219
- /**
220
- * Infer the type of a deeply nested property within an object or an array.
221
- */
222
- type DeepValue<TValue, TAccessor> = unknown extends TValue ? TValue : TAccessor extends DeepKeys<TValue> ? DeepRecord<TValue>[TAccessor] : never;
223
- /**
224
- * The keys of an object or array, deeply nested and only with a value of TValue
225
- */
226
- type DeepKeysOfType<TData, TValue> = Extract<DeepKeysAndValues<TData>, AnyDeepKeyAndValue<string, TValue>>['key'];
227
- //#endregion
228
- //#region ../../node_modules/.pnpm/@tanstack+form-core@1.33.5/node_modules/@tanstack/form-core/dist/esm/utils.d.ts
229
- type UpdaterFn<TInput, TOutput = TInput> = (input: TInput) => TOutput;
230
- type Updater<TInput, TOutput = TInput> = TOutput | UpdaterFn<TInput, TOutput>;
231
- //#endregion
232
- //#region ../../node_modules/.pnpm/@tanstack+form-core@1.33.5/node_modules/@tanstack/form-core/dist/esm/FieldApi.d.ts
233
- /**
234
- * @private
235
- */
236
- type FieldValidateFn<TParentData, TName extends DeepKeys<TParentData>, TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>> = (props: {
237
- value: TData;
238
- fieldApi: FieldApi<TParentData, TName, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
239
- }) => unknown;
240
- /**
241
- * @private
242
- */
243
- type FieldValidateAsyncFn<TParentData, TName extends DeepKeys<TParentData>, TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>> = (options: {
244
- value: TData;
245
- fieldApi: FieldApi<TParentData, TName, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
246
- signal: AbortSignal;
247
- }) => unknown | Promise<unknown>;
248
- /**
249
- * @private
250
- */
251
- type FieldListenerFn<TParentData, TName extends DeepKeys<TParentData>, TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>> = (props: {
252
- value: TData;
253
- fieldApi: FieldApi<TParentData, TName, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
254
- }) => void;
255
- /**
256
- * @private
257
- */
258
- type FieldValidateOrFn<TParentData, TName extends DeepKeys<TParentData>, TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>> = FieldValidateFn<TParentData, TName, TData> | StandardSchemaV1<TData, unknown>;
259
- /**
260
- * @private
261
- */
262
- type FieldAsyncValidateOrFn<TParentData, TName extends DeepKeys<TParentData>, TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>> = FieldValidateAsyncFn<TParentData, TName, TData> | StandardSchemaV1<TData, unknown>;
263
- interface FieldValidators<TParentData, TName extends DeepKeys<TParentData>, TData extends DeepValue<TParentData, TName>, TOnMount extends undefined | FieldValidateOrFn<TParentData, TName, TData>, TOnChange extends undefined | FieldValidateOrFn<TParentData, TName, TData>, TOnChangeAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData>, TOnBlur extends undefined | FieldValidateOrFn<TParentData, TName, TData>, TOnBlurAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData>, TOnSubmit extends undefined | FieldValidateOrFn<TParentData, TName, TData>, TOnSubmitAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData>, TOnDynamic extends undefined | FieldValidateOrFn<TParentData, TName, TData>, TOnDynamicAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData>> {
264
- /**
265
- * An optional function, that runs on the mount event of input.
266
- */
267
- onMount?: RejectPromiseValidator<TOnMount>;
268
- /**
269
- * An optional function, that runs on the change event of input.
270
- *
271
- * @example z.string().min(1)
272
- */
273
- onChange?: RejectPromiseValidator<TOnChange>;
274
- /**
275
- * An optional property similar to `onChange` but async validation
276
- *
277
- * @example z.string().refine(async (val) => val.length > 3, { message: 'Testing 123' })
278
- */
279
- onChangeAsync?: TOnChangeAsync;
280
- /**
281
- * An optional number to represent how long the `onChangeAsync` should wait before running
282
- *
283
- * If set to a number larger than 0, will debounce the async validation event by this length of time in milliseconds
284
- */
285
- onChangeAsyncDebounceMs?: number;
286
- /**
287
- * An optional list of field names that should trigger this field's `onChange` and `onChangeAsync` events when its value changes
288
- */
289
- onChangeListenTo?: DeepKeys<TParentData>[];
290
- /**
291
- * An optional function, that runs on the blur event of input.
292
- *
293
- * @example z.string().min(1)
294
- */
295
- onBlur?: RejectPromiseValidator<TOnBlur>;
296
- /**
297
- * An optional property similar to `onBlur` but async validation.
298
- *
299
- * @example z.string().refine(async (val) => val.length > 3, { message: 'Testing 123' })
300
- */
301
- onBlurAsync?: TOnBlurAsync;
302
- /**
303
- * An optional number to represent how long the `onBlurAsync` should wait before running
304
- *
305
- * If set to a number larger than 0, will debounce the async validation event by this length of time in milliseconds
306
- */
307
- onBlurAsyncDebounceMs?: number;
308
- /**
309
- * An optional list of field names that should trigger this field's `onBlur` and `onBlurAsync` events when its value changes
310
- */
311
- onBlurListenTo?: DeepKeys<TParentData>[];
312
- /**
313
- * An optional function, that runs on the submit event of form.
314
- *
315
- * @example z.string().min(1)
316
- */
317
- onSubmit?: RejectPromiseValidator<TOnSubmit>;
318
- /**
319
- * An optional property similar to `onSubmit` but async validation.
320
- *
321
- * @example z.string().refine(async (val) => val.length > 3, { message: 'Testing 123' })
322
- */
323
- onSubmitAsync?: TOnSubmitAsync;
324
- onDynamic?: RejectPromiseValidator<TOnDynamic>;
325
- onDynamicAsync?: TOnDynamicAsync;
326
- onDynamicAsyncDebounceMs?: number;
327
- }
328
- interface FieldListeners<TParentData, TName extends DeepKeys<TParentData>, TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>> {
329
- onChange?: FieldListenerFn<TParentData, TName, TData>;
330
- onChangeDebounceMs?: number;
331
- onBlur?: FieldListenerFn<TParentData, TName, TData>;
332
- onBlurDebounceMs?: number;
333
- onMount?: FieldListenerFn<TParentData, TName, TData>;
334
- onUnmount?: FieldListenerFn<TParentData, TName, TData>;
335
- onSubmit?: FieldListenerFn<TParentData, TName, TData>;
336
- onGroupSubmit?: FieldListenerFn<TParentData, TName, TData>;
337
- }
338
- interface FieldExtraOptions<TParentData, TName extends DeepKeys<TParentData>, TData extends DeepValue<TParentData, TName>, TOnMount extends undefined | FieldValidateOrFn<TParentData, TName, TData>, TOnChange extends undefined | FieldValidateOrFn<TParentData, TName, TData>, TOnChangeAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData>, TOnBlur extends undefined | FieldValidateOrFn<TParentData, TName, TData>, TOnBlurAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData>, TOnSubmit extends undefined | FieldValidateOrFn<TParentData, TName, TData>, TOnSubmitAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData>, TOnDynamic extends undefined | FieldValidateOrFn<TParentData, TName, TData>, TOnDynamicAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData>> {
339
- /**
340
- * A list of validators to pass to the field
341
- */
342
- validators?: FieldValidators<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync>;
343
- /**
344
- * A list of listeners which attach to the corresponding events
345
- */
346
- listeners?: FieldListeners<TParentData, TName, TData>;
347
- }
348
- interface FieldApiOptions<in out TParentData, in out TName extends DeepKeys<TParentData>, in out TData extends DeepValue<TParentData, TName>, in out TOnMount extends undefined | FieldValidateOrFn<TParentData, TName, TData>, in out TOnChange extends undefined | FieldValidateOrFn<TParentData, TName, TData>, in out TOnChangeAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData>, in out TOnBlur extends undefined | FieldValidateOrFn<TParentData, TName, TData>, in out TOnBlurAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData>, in out TOnSubmit extends undefined | FieldValidateOrFn<TParentData, TName, TData>, in out TOnSubmitAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData>, in out TOnDynamic extends undefined | FieldValidateOrFn<TParentData, TName, TData>, in out TOnDynamicAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData>, in out TFormOnMount extends undefined | FormValidateOrFn<TParentData>, in out TFormOnChange extends undefined | FormValidateOrFn<TParentData>, in out TFormOnChangeAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnBlur extends undefined | FormValidateOrFn<TParentData>, in out TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnSubmit extends undefined | FormValidateOrFn<TParentData>, in out TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnDynamic extends undefined | FormValidateOrFn<TParentData>, in out TFormOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnServer extends undefined | FormAsyncValidateOrFn<TParentData>, in out TParentSubmitMeta> extends FieldLikeApiOptions<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta>, FieldExtraOptions<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync> {}
349
- /**
350
- * @public
351
- *
352
- * A type representing the Field API with all generics set to `any` for convenience.
353
- */
354
- type AnyFieldApi = FieldApi<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
355
- /**
356
- * We cannot use methods and must use arrow functions. Otherwise, our React adapters
357
- * will break due to loss of the method when using spread.
358
- */
359
- /**
360
- * A class representing the API for managing a form field.
361
- *
362
- * Normally, you will not need to create a new `FieldApi` instance directly.
363
- * Instead, you will use a framework hook/function like `useField` or `createField`
364
- * to create a new instance for you that uses your framework's reactivity model.
365
- * However, if you need to create a new instance manually, you can do so by calling
366
- * the `new FieldApi` constructor.
367
- */
368
- declare class FieldApi<in out TParentData, in out TName extends DeepKeys<TParentData>, in out TData extends DeepValue<TParentData, TName>, in out TOnMount extends undefined | FieldValidateOrFn<TParentData, TName, TData>, in out TOnChange extends undefined | FieldValidateOrFn<TParentData, TName, TData>, in out TOnChangeAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData>, in out TOnBlur extends undefined | FieldValidateOrFn<TParentData, TName, TData>, in out TOnBlurAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData>, in out TOnSubmit extends undefined | FieldValidateOrFn<TParentData, TName, TData>, in out TOnSubmitAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData>, in out TOnDynamic extends undefined | FieldValidateOrFn<TParentData, TName, TData>, in out TOnDynamicAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData>, in out TFormOnMount extends undefined | FormValidateOrFn<TParentData>, in out TFormOnChange extends undefined | FormValidateOrFn<TParentData>, in out TFormOnChangeAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnBlur extends undefined | FormValidateOrFn<TParentData>, in out TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnSubmit extends undefined | FormValidateOrFn<TParentData>, in out TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnDynamic extends undefined | FormValidateOrFn<TParentData>, in out TFormOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnServer extends undefined | FormAsyncValidateOrFn<TParentData>, in out TParentSubmitMeta> implements FieldLikeAPI<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta, FieldExtraOptions<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync>> {
369
- /**
370
- * A reference to the form API instance.
371
- */
372
- form: FieldApiOptions<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta>['form'];
373
- /**
374
- * The field name.
375
- */
376
- name: TName;
377
- /**
378
- * The field options.
379
- */
380
- options: FieldApiOptions<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta>;
381
- /**
382
- * The field state store.
383
- */
384
- store: ReadonlyStore<FieldLikeState<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync>>;
385
- /**
386
- * The current field state.
387
- */
388
- get state(): FieldLikeState<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync>;
389
- timeoutIds: {
390
- validations: Record<ValidationCause, ReturnType<typeof setTimeout> | null>;
391
- listeners: Record<ListenerCause, ReturnType<typeof setTimeout> | null>;
392
- formListeners: Record<ListenerCause, ReturnType<typeof setTimeout> | null>;
393
- };
394
- /**
395
- * Initializes a new `FieldApi` instance.
396
- */
397
- constructor(opts: FieldApiOptions<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta>);
398
- /**
399
- * @private
400
- */
401
- runValidator<TValue extends TStandardSchemaValidatorValue<TData> & {
402
- fieldApi: AnyFieldApi;
403
- }, TType extends 'validate' | 'validateAsync'>(props: {
404
- validate: TType extends 'validate' ? FieldValidateOrFn<any, any, any> : FieldAsyncValidateOrFn<any, any, any>;
405
- value: TValue;
406
- type: TType;
407
- }): unknown;
408
- /**
409
- * Mounts the field instance to the form.
410
- * @returns A function to unmount the field instance.
411
- */
412
- mount: () => () => void;
413
- /**
414
- * Updates the field instance with new options.
415
- */
416
- update: (opts: FieldApiOptions<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta>) => void;
417
- /**
418
- * Gets the current field value.
419
- * @deprecated Use `field.state.value` instead.
420
- */
421
- getValue: () => TData;
422
- /**
423
- * Sets the field value and run the `change` validator.
424
- */
425
- setValue: (updater: Updater<TData>, options?: UpdateMetaOptions) => void;
426
- getMeta: () => FieldLikeMeta<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync>;
427
- /**
428
- * Sets the field metadata.
429
- */
430
- setMeta: (updater: Updater<FieldLikeMetaBase<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync>>) => void;
431
- /**
432
- * Gets the field information object.
433
- */
434
- getInfo: () => FieldInfo<TParentData>;
435
- /**
436
- * Pushes a new value to the field.
437
- */
438
- pushValue: (value: TData extends any[] ? TData[number] : never, options?: UpdateMetaOptions) => void;
439
- /**
440
- * Inserts a value at the specified index, shifting the subsequent values to the right.
441
- */
442
- insertValue: (index: number, value: TData extends any[] ? TData[number] : never, options?: UpdateMetaOptions) => void;
443
- /**
444
- * Replaces a value at the specified index.
445
- */
446
- replaceValue: (index: number, value: TData extends any[] ? TData[number] : never, options?: UpdateMetaOptions) => void;
447
- /**
448
- * Removes a value at the specified index.
449
- */
450
- removeValue: (index: number, options?: UpdateMetaOptions) => void;
451
- /**
452
- * Swaps the values at the specified indices.
453
- */
454
- swapValues: (aIndex: number, bIndex: number, options?: UpdateMetaOptions) => void;
455
- /**
456
- * Moves the value at the first specified index to the second specified index.
457
- */
458
- moveValue: (aIndex: number, bIndex: number, options?: UpdateMetaOptions) => void;
459
- /**
460
- * Clear all values from the array.
461
- */
462
- clearValues: (options?: UpdateMetaOptions) => void;
463
- /**
464
- * @private
465
- */
466
- getLinkedFields: (cause: ValidationCause) => AnyFieldApi[];
467
- /**
468
- * @private
469
- */
470
- validateSync: (cause: ValidationCause, errorFromForm: ValidationErrorMap) => {
471
- hasErrored: boolean;
472
- };
473
- /**
474
- * `@private`
475
- * Starts tracking an async validation, incrementing the counter and setting isValidating if needed.
476
- */
477
- private startValidation;
478
- /**
479
- * `@private`
480
- * Ends tracking an async validation, decrementing the counter and clearing isValidating if no validations remain.
481
- */
482
- private endValidation;
483
- /**
484
- * @private
485
- */
486
- validateAsync: (cause: ValidationCause, formValidationResultPromise: Promise<FieldErrorMapFromValidator<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync>>) => Promise<unknown[]>;
487
- /**
488
- * Validates the field value.
489
- */
490
- validate: (cause: ValidationCause, opts?: {
491
- skipFormValidation?: boolean;
492
- skipGroupValidation?: boolean;
493
- }) => ValidationError[] | Promise<ValidationError[]>;
494
- /**
495
- * Handles the change event.
496
- */
497
- handleChange: (updater: Updater<TData>) => void;
498
- /**
499
- * Handles the blur event.
500
- */
501
- handleBlur: () => void;
502
- /**
503
- * Updates the field's errorMap
504
- */
505
- setErrorMap: (errorMap: ValidationErrorMap<UnwrapFieldValidateOrFn<TName, TOnMount, TFormOnMount>, UnwrapFieldValidateOrFn<TName, TOnChange, TFormOnChange>, UnwrapFieldAsyncValidateOrFn<TName, TOnChangeAsync, TFormOnChangeAsync>, UnwrapFieldValidateOrFn<TName, TOnBlur, TFormOnBlur>, UnwrapFieldAsyncValidateOrFn<TName, TOnBlurAsync, TFormOnBlurAsync>, UnwrapFieldValidateOrFn<TName, TOnSubmit, TFormOnSubmit>, UnwrapFieldAsyncValidateOrFn<TName, TOnSubmitAsync, TFormOnSubmitAsync>, UnwrapFieldValidateOrFn<TName, TOnDynamic, TFormOnDynamic>, UnwrapFieldAsyncValidateOrFn<TName, TOnDynamicAsync, TFormOnDynamicAsync>>) => void;
506
- /**
507
- * Parses the field's value with the given schema and returns
508
- * issues (if any). This method does NOT set any internal errors.
509
- * @param schema The standard schema to parse this field's value with.
510
- */
511
- parseValueWithSchema: (schema: StandardSchemaV1<TData, unknown>) => StandardSchemaV1Issue[] | undefined;
512
- /**
513
- * Parses the field's value with the given schema and returns
514
- * issues (if any). This method does NOT set any internal errors.
515
- * @param schema The standard schema to parse this field's value with.
516
- */
517
- parseValueWithSchemaAsync: (schema: StandardSchemaV1<TData, unknown>) => Promise<StandardSchemaV1Issue[] | undefined>;
518
- private triggerOnBlurListener;
519
- /**
520
- * @private
521
- */
522
- triggerOnChangeListener: () => void;
523
- /**
524
- * @private
525
- */
526
- triggerOnSubmitListener: () => void;
527
- }
528
- //#endregion
529
- //#region ../../node_modules/.pnpm/@tanstack+form-core@1.33.5/node_modules/@tanstack/form-core/dist/esm/ValidationLogic.d.ts
530
- interface ValidationLogicValidatorsFn {
531
- fn: FormValidators<any, any, any, any, any, any, any, any, any, any>[keyof FormValidators<any, any, any, any, any, any, any, any, any, any>];
532
- cause: 'change' | 'blur' | 'submit' | 'mount' | 'server' | 'dynamic';
533
- }
534
- interface ValidationLogicProps {
535
- form: AnyFormApi;
536
- /**
537
- * Set when the validators being processed belong to a `FormGroupApi`.
538
- * Allows validation strategies (e.g. `revalidateLogic`) to gate their
539
- * behavior on the group's own state instead of the parent form's.
540
- */
541
- group?: AnyFormGroupApi;
542
- validators: FormValidators<any, any, any, any, any, any, any, any, any, any> | undefined | null;
543
- event: {
544
- type: 'blur' | 'change' | 'submit' | 'mount' | 'server';
545
- fieldName?: string;
546
- async: boolean;
547
- };
548
- runValidation: (props: {
549
- validators: Array<ValidationLogicValidatorsFn | undefined>;
550
- form: AnyFormApi;
551
- }) => void;
552
- }
553
- type ValidationLogicFn = (props: ValidationLogicProps) => void;
554
- //#endregion
555
- //#region ../../node_modules/.pnpm/@tanstack+form-core@1.33.5/node_modules/@tanstack/form-core/dist/esm/FormGroupApi.d.ts
556
- /**
557
- * @private
558
- */
559
- type FormGroupValidateFn<TParentData, TName extends DeepKeys<TParentData>, TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>> = (props: {
560
- value: TData;
561
- groupApi: FormGroupApi<TParentData, TName, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
562
- }) => unknown;
563
- /**
564
- * @private
565
- */
566
- type FormGroupValidateOrFn<TParentData, TName extends DeepKeys<TParentData>, TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>> = FormGroupValidateFn<TParentData, TName, TData> | StandardSchemaV1<TData, unknown>;
567
- /**
568
- * @private
569
- */
570
- type FormGroupValidateAsyncFn<TParentData, TName extends DeepKeys<TParentData>, TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>> = (options: {
571
- value: TData;
572
- groupApi: FormGroupApi<TParentData, TName, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
573
- signal: AbortSignal;
574
- }) => unknown | Promise<unknown>;
575
- /**
576
- * @private
577
- */
578
- type FormGroupAsyncValidateOrFn<TParentData, TName extends DeepKeys<TParentData>, TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>> = FormGroupValidateAsyncFn<TParentData, TName, TData> | StandardSchemaV1<TData, unknown>;
579
- /**
580
- * @private
581
- */
582
- type FormGroupListenerFn<TParentData, TName extends DeepKeys<TParentData>, TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>> = (props: {
583
- value: TData;
584
- groupApi: FormGroupApi<TParentData, TName, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
585
- }) => void;
586
- interface FormGroupValidators<TParentData, TName extends DeepKeys<TParentData>, TData extends DeepValue<TParentData, TName>, TOnMount extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, TOnChange extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, TOnChangeAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, TOnBlur extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, TOnBlurAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, TOnSubmit extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, TOnSubmitAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, TOnDynamic extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, TOnDynamicAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>> {
587
- /**
588
- * An optional function, that runs on the mount event of input.
589
- */
590
- onMount?: TOnMount;
591
- /**
592
- * An optional function, that runs on the change event of input.
593
- *
594
- * @example z.string().min(1)
595
- */
596
- onChange?: TOnChange;
597
- /**
598
- * An optional property similar to `onChange` but async validation
599
- *
600
- * @example z.string().refine(async (val) => val.length > 3, { message: 'Testing 123' })
601
- */
602
- onChangeAsync?: TOnChangeAsync;
603
- /**
604
- * An optional number to represent how long the `onChangeAsync` should wait before running
605
- *
606
- * If set to a number larger than 0, will debounce the async validation event by this length of time in milliseconds
607
- */
608
- onChangeAsyncDebounceMs?: number;
609
- /**
610
- * An optional list of field names that should trigger this field's `onChange` and `onChangeAsync` events when its value changes
611
- */
612
- /**
613
- * An optional function, that runs on the blur event of input.
614
- *
615
- * @example z.string().min(1)
616
- */
617
- onBlur?: TOnBlur;
618
- /**
619
- * An optional property similar to `onBlur` but async validation.
620
- *
621
- * @example z.string().refine(async (val) => val.length > 3, { message: 'Testing 123' })
622
- */
623
- onBlurAsync?: TOnBlurAsync;
624
- /**
625
- * An optional number to represent how long the `onBlurAsync` should wait before running
626
- *
627
- * If set to a number larger than 0, will debounce the async validation event by this length of time in milliseconds
628
- */
629
- onBlurAsyncDebounceMs?: number;
630
- /**
631
- * An optional list of field names that should trigger this field's `onBlur` and `onBlurAsync` events when its value changes
632
- */
633
- /**
634
- * An optional function, that runs on the submit event of form.
635
- *
636
- * @example z.string().min(1)
637
- */
638
- onSubmit?: TOnSubmit;
639
- /**
640
- * An optional property similar to `onSubmit` but async validation.
641
- *
642
- * @example z.string().refine(async (val) => val.length > 3, { message: 'Testing 123' })
643
- */
644
- onSubmitAsync?: TOnSubmitAsync;
645
- onDynamic?: TOnDynamic;
646
- onDynamicAsync?: TOnDynamicAsync;
647
- onDynamicAsyncDebounceMs?: number;
648
- }
649
- interface FormGroupListeners<TParentData, TName extends DeepKeys<TParentData>, TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>> {
650
- onChange?: FormGroupListenerFn<TParentData, TName, TData>;
651
- onChangeDebounceMs?: number;
652
- onBlur?: FormGroupListenerFn<TParentData, TName, TData>;
653
- onBlurDebounceMs?: number;
654
- onMount?: FormGroupListenerFn<TParentData, TName, TData>;
655
- onUnmount?: FormGroupListenerFn<TParentData, TName, TData>;
656
- onSubmit?: FormGroupListenerFn<TParentData, TName, TData>;
657
- onGroupSubmit?: FormGroupListenerFn<TParentData, TName, TData>;
658
- }
659
- interface FormGroupExtraOptions<in out TParentData, in out TName extends DeepKeys<TParentData>, in out TData extends DeepValue<TParentData, TName>, in out TOnMount extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnChange extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnChangeAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnBlur extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnBlurAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnSubmit extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnSubmitAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnDynamic extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnDynamicAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TSubmitMeta, in out TFormOnMount extends undefined | FormValidateOrFn<TParentData>, in out TFormOnChange extends undefined | FormValidateOrFn<TParentData>, in out TFormOnChangeAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnBlur extends undefined | FormValidateOrFn<TParentData>, in out TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnSubmit extends undefined | FormValidateOrFn<TParentData>, in out TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnDynamic extends undefined | FormValidateOrFn<TParentData>, in out TFormOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnServer extends undefined | FormAsyncValidateOrFn<TParentData>, in out TParentSubmitMeta> {
660
- /**
661
- * A list of validators to pass to the field
662
- */
663
- validators?: FormGroupValidators<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync>;
664
- /**
665
- * If true, allows the form to be submitted in an invalid state i.e. canSubmit will remain true regardless of validation errors. Defaults to undefined.
666
- */
667
- canSubmitWhenInvalid?: boolean;
668
- /**
669
- * A list of listeners which attach to the corresponding events
670
- */
671
- listeners?: FormGroupListeners<TParentData, TName, TData>;
672
- defaultState?: FormGroupState;
673
- /**
674
- * Optional validation logic strategy to use for this group's own
675
- * validators (e.g. `revalidateLogic()`). When omitted, the parent form's
676
- * `validationLogic` (or the default) is used.
677
- */
678
- validationLogic?: ValidationLogicFn;
679
- /**
680
- * onSubmitMeta, the data passed from the handleSubmit handler, to the onSubmit function props
681
- */
682
- onSubmitMeta?: TSubmitMeta;
683
- /**
684
- * A function to be called when the form is submitted, what should happen once the user submits a valid form returns `any` or a promise `Promise<any>`
685
- */
686
- onGroupSubmit?: (props: {
687
- value: TData;
688
- groupApi: FormGroupApi<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TSubmitMeta, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta>;
689
- meta: TSubmitMeta;
690
- }) => any | Promise<any>;
691
- /**
692
- * Specify an action for scenarios where the user tries to submit an invalid form.
693
- */
694
- onGroupSubmitInvalid?: (props: {
695
- value: TData;
696
- groupApi: FormGroupApi<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TSubmitMeta, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta>;
697
- meta: TSubmitMeta;
698
- }) => void;
699
- }
700
- interface FormGroupOptions<in out TParentData, in out TName extends DeepKeys<TParentData>, in out TData extends DeepValue<TParentData, TName>, in out TOnMount extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnChange extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnChangeAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnBlur extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnBlurAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnSubmit extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnSubmitAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnDynamic extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnDynamicAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TSubmitMeta, in out TFormOnMount extends undefined | FormValidateOrFn<TParentData>, in out TFormOnChange extends undefined | FormValidateOrFn<TParentData>, in out TFormOnChangeAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnBlur extends undefined | FormValidateOrFn<TParentData>, in out TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnSubmit extends undefined | FormValidateOrFn<TParentData>, in out TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnDynamic extends undefined | FormValidateOrFn<TParentData>, in out TFormOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnServer extends undefined | FormAsyncValidateOrFn<TParentData>, in out TParentSubmitMeta> extends FieldLikeOptions<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync>, FormGroupExtraOptions<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TSubmitMeta, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta> {}
701
- interface FormGroupApiOptions<in out TParentData, in out TName extends DeepKeys<TParentData>, in out TData extends DeepValue<TParentData, TName>, in out TOnMount extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnChange extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnChangeAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnBlur extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnBlurAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnSubmit extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnSubmitAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnDynamic extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnDynamicAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TSubmitMeta, in out TFormOnMount extends undefined | FormValidateOrFn<TParentData>, in out TFormOnChange extends undefined | FormValidateOrFn<TParentData>, in out TFormOnChangeAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnBlur extends undefined | FormValidateOrFn<TParentData>, in out TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnSubmit extends undefined | FormValidateOrFn<TParentData>, in out TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnDynamic extends undefined | FormValidateOrFn<TParentData>, in out TFormOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnServer extends undefined | FormAsyncValidateOrFn<TParentData>, in out TParentSubmitMeta> extends FormGroupOptions<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TSubmitMeta, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta> {
702
- form: FormApi<TParentData, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta>;
703
- }
704
- interface FormGroupState {
705
- /**
706
- * A boolean indicating if the form is currently in the process of being submitted after `handleSubmit` is called.
707
- *
708
- * Goes back to `false` when submission completes for one of the following reasons:
709
- * - the validation step returned errors.
710
- * - the `onSubmit` function has completed.
711
- *
712
- * Note: if you're running async operations in your `onSubmit` function make sure to await them to ensure `isSubmitting` is set to `false` only when the async operation completes.
713
- *
714
- * This is useful for displaying loading indicators or disabling form inputs during submission.
715
- *
716
- */
717
- isSubmitting: boolean;
718
- /**
719
- * A boolean indicating if the `onSubmit` function has completed successfully.
720
- *
721
- * Goes back to `false` at each new submission attempt.
722
- *
723
- * Note: you can use isSubmitting to check if the form is currently submitting.
724
- */
725
- isSubmitted: boolean;
726
- /**
727
- * A boolean indicating if the form or any of its fields are currently validating.
728
- */
729
- isValidating: boolean;
730
- /**
731
- * A counter for tracking the number of submission attempts.
732
- */
733
- submissionAttempts: number;
734
- /**
735
- * A boolean indicating if the last submission was successful.
736
- */
737
- isSubmitSuccessful: boolean;
738
- }
739
- /**
740
- * @public
741
- *
742
- * A type representing the FormGroup API with all generics set to `any` for convenience.
743
- */
744
- type AnyFormGroupApi = FormGroupApi<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
745
- /**
746
- * @public
747
- *
748
- * The `meta` shape exposed on `FormGroupApi.state.meta`. Mirrors
749
- * `FieldApi.state.meta` (since `FormGroupMeta extends FieldLikeMeta`) but
750
- * additionally surfaces the group's submission lifecycle and aggregated
751
- * validity flags. All derivation lives on the parent `FormApi` (in
752
- * `formGroupMetaDerived`), keeping per-instance `FormGroupApi.store` as
753
- * minimal as `FieldApi.store`.
754
- *
755
- * Aggregated booleans (`isTouched`, `isBlurred`, `isDirty`, `isPristine`,
756
- * `isDefaultValue`) are computed across the group's descendant fields
757
- * rather than the group's own field-meta entry.
758
- */
759
- interface FormGroupMeta<in out TParentData, in out TName extends DeepKeys<TParentData>, in out TData extends DeepValue<TParentData, TName>, in out TOnMount extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnChange extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnChangeAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnBlur extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnBlurAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnSubmit extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnSubmitAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnDynamic extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnDynamicAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TFormOnMount extends undefined | FormValidateOrFn<TParentData>, in out TFormOnChange extends undefined | FormValidateOrFn<TParentData>, in out TFormOnChangeAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnBlur extends undefined | FormValidateOrFn<TParentData>, in out TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnSubmit extends undefined | FormValidateOrFn<TParentData>, in out TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnDynamic extends undefined | FormValidateOrFn<TParentData>, in out TFormOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TParentData>> extends FieldLikeMeta<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync>, FormGroupState {
760
- isFieldsValidating: boolean;
761
- isFieldsValid: boolean;
762
- isGroupValid: boolean;
763
- isValid: boolean;
764
- canSubmit: boolean;
765
- }
766
- /**
767
- * @public
768
- *
769
- * `FormGroupMeta` with all generics widened to `any`.
770
- */
771
- type AnyFormGroupMeta = FormGroupMeta<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
772
- interface FormGroupStoreState<in out TParentData, in out TName extends DeepKeys<TParentData>, in out TData extends DeepValue<TParentData, TName>, in out TOnMount extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnChange extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnChangeAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnBlur extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnBlurAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnSubmit extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnSubmitAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnDynamic extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnDynamicAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TFormOnMount extends undefined | FormValidateOrFn<TParentData>, in out TFormOnChange extends undefined | FormValidateOrFn<TParentData>, in out TFormOnChangeAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnBlur extends undefined | FormValidateOrFn<TParentData>, in out TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnSubmit extends undefined | FormValidateOrFn<TParentData>, in out TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnDynamic extends undefined | FormValidateOrFn<TParentData>, in out TFormOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TParentData>> {
773
- /**
774
- * The current value of the form group.
775
- */
776
- value: TData;
777
- /**
778
- * The current metadata of the form group, including aggregated validity,
779
- * group-level errors, and submission lifecycle.
780
- */
781
- meta: FormGroupMeta<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync>;
782
- }
783
- declare class FormGroupApi<in out TParentData, in out TName extends DeepKeys<TParentData>, in out TData extends DeepValue<TParentData, TName>, in out TOnMount extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnChange extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnChangeAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnBlur extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnBlurAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnSubmit extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnSubmitAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnDynamic extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnDynamicAsync extends undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TSubmitMeta, in out TFormOnMount extends undefined | FormValidateOrFn<TParentData>, in out TFormOnChange extends undefined | FormValidateOrFn<TParentData>, in out TFormOnChangeAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnBlur extends undefined | FormValidateOrFn<TParentData>, in out TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnSubmit extends undefined | FormValidateOrFn<TParentData>, in out TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnDynamic extends undefined | FormValidateOrFn<TParentData>, in out TFormOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnServer extends undefined | FormAsyncValidateOrFn<TParentData>, in out TParentSubmitMeta> implements FormLikeAPI<TParentData, TSubmitMeta>, FieldLikeAPI<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta, FormGroupExtraOptions<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TSubmitMeta, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta>> {
784
- /**
785
- * A reference to the form API instance.
786
- */
787
- form: FormGroupApiOptions<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TSubmitMeta, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta>['form'];
788
- /**
789
- * The field name.
790
- */
791
- name: TName;
792
- /**
793
- * The field options.
794
- */
795
- options: FormGroupApiOptions<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TSubmitMeta, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta>;
796
- /**
797
- * The field state store.
798
- */
799
- store: ReadonlyStore<FormGroupStoreState<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync>>;
800
- /**
801
- * The current field state.
802
- */
803
- get state(): FormGroupStoreState<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync>;
804
- /**
805
- * @private
806
- *
807
- * Updates this group's submission lifecycle state on the parent form's
808
- * `baseStore` (where group state is now persisted), preserving entries
809
- * for any other mounted groups. After writing, the form's
810
- * `formGroupMetaDerived` re-derives so this group's `state.meta` picks
811
- * up the new lifecycle values automatically.
812
- */
813
- private setFormGroupState;
814
- timeoutIds: {
815
- validations: Record<ValidationCause, ReturnType<typeof setTimeout> | null>;
816
- listeners: Record<ListenerCause, ReturnType<typeof setTimeout> | null>;
817
- formListeners: Record<ListenerCause, ReturnType<typeof setTimeout> | null>;
818
- };
819
- /**
820
- * @private
821
- *
822
- * Tracks the set of fully-qualified child field names that this group's
823
- * validators last set form-source errors on, keyed by `errorMap` key.
824
- * Used to clear stale group-level field errors on subsequent runs without
825
- * trampling errors set by the parent form's validators.
826
- */
827
- private _lastDistributedFieldNames;
828
- private fieldInfo;
829
- constructor(opts: FormGroupApiOptions<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TSubmitMeta, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta>);
830
- /**
831
- * Updates the field instance with new options.
832
- */
833
- update: (opts: FormGroupApiOptions<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TSubmitMeta, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta>) => void;
834
- /**
835
- * @private
836
- */
837
- runValidator<TValue extends TStandardSchemaValidatorValue<TData> & {
838
- groupApi: AnyFormGroupApi;
839
- }, TType extends 'validate' | 'validateAsync'>(props: {
840
- validate: TType extends 'validate' ? FormGroupValidateOrFn<any, any, any> : FormGroupAsyncValidateOrFn<any, any, any>;
841
- value: TValue;
842
- type: TType;
843
- }): unknown;
844
- mount: () => () => void;
845
- /**
846
- * Sets the field value and run the `change` validator.
847
- */
848
- setValue: (updater: Updater<TData>, options?: UpdateMetaOptions) => void;
849
- getMeta: () => FormGroupMeta<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync>;
850
- /**
851
- * Sets the field metadata.
852
- */
853
- setMeta: (updater: Updater<FieldLikeMetaBase<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync>>) => void;
854
- /**
855
- * Gets the field information object.
856
- */
857
- getInfo: () => FieldInfo<TParentData>;
858
- /**
859
- * @private
860
- */
861
- getRelatedFields: () => AnyFieldApi[];
862
- /**
863
- * @private
864
- */
865
- getRelatedFieldMetasDerived: () => (FieldLikeMetaBase<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any> & FieldLikeMetaDerived<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any> & {
866
- name: string;
867
- })[];
868
- /**
869
- * @private
870
- *
871
- * Builds a fully-qualified field name from a path that is relative to this
872
- * group, supporting both dot (`name`, `nested.value`) and bracket
873
- * (`[0].name`) notation.
874
- */
875
- private buildChildFieldName;
876
- /**
877
- * @private
878
- *
879
- * Distributes a `{ fields: { ... } }` payload returned by one of this
880
- * group's own validators onto the corresponding child fields. Tracks
881
- * which fields have been touched so subsequent runs can clear stale
882
- * errors without trampling errors set by the parent form's validators.
883
- */
884
- private distributeFieldErrors;
885
- /**
886
- * @private
887
- */
888
- validateSync: (cause: ValidationCause, errorFromForm: ValidationErrorMap, opts?: {
889
- skipRelatedFieldValidation?: boolean;
890
- }) => {
891
- hasErrored: boolean;
892
- };
893
- /**
894
- * @private
895
- */
896
- validateAsync: (cause: ValidationCause, formValidationResultPromise: Promise<FieldErrorMapFromValidator<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync>>, opts?: {
897
- skipRelatedFieldValidation?: boolean;
898
- }) => Promise<unknown[]>;
899
- /**
900
- * Validates all fields according to the FIELD level validators.
901
- * This will ignore FORM level validators, use form.validate({ValidationCause}) for a complete validation
902
- */
903
- validateAllFields: (cause: ValidationCause) => Promise<unknown[]>;
904
- validateArrayFieldsStartingFrom: <TField extends DeepKeysOfType<TParentData, any[]>>(field: TField, index: number, cause: ValidationCause) => Promise<unknown[]>;
905
- validateField: <TField extends DeepKeysOfType<TParentData, any>>(field: TField, cause: ValidationCause) => any[] | Promise<any[]>;
906
- getFieldValue: <TField extends DeepKeysOfType<TParentData, any>>(field: TField) => DeepValue<TParentData, TField>;
907
- getFieldMeta: <TField extends DeepKeysOfType<TParentData, any>>(field: TField) => AnyFieldLikeMeta | undefined;
908
- setFieldMeta: <TField extends DeepKeysOfType<TParentData, any>>(field: TField, updater: Updater<AnyFieldLikeMetaBase>) => void;
909
- setFieldValue: <TField extends DeepKeysOfType<TParentData, any>>(field: TField, value: any) => void;
910
- deleteField: <TField extends DeepKeysOfType<TParentData, any>>(field: TField) => void;
911
- pushFieldValue: <TField extends DeepKeysOfType<TParentData, any[]>>(field: TField, value: any) => void;
912
- insertFieldValue: <TField extends DeepKeysOfType<TParentData, any[]>>(field: TField, index: number, value: any) => Promise<void>;
913
- replaceFieldValue: <TField extends DeepKeysOfType<TParentData, any[]>>(field: TField, index: number, value: any) => Promise<void>;
914
- swapFieldValues: <TField extends DeepKeysOfType<TParentData, any[]>>(field: TField, index1: number, index2: number) => void;
915
- moveFieldValues: <TField extends DeepKeysOfType<TParentData, any[]>>(field: TField, fromIndex: number, toIndex: number) => void;
916
- clearFieldValues: <TField extends DeepKeysOfType<TParentData, any[]>>(field: TField) => void;
917
- resetField: <TField extends DeepKeysOfType<TParentData, any>>(field: TField) => void;
918
- removeFieldValue: <TField extends DeepKeysOfType<TParentData, any[]>>(field: TField, index: number) => Promise<void>;
919
- areRelatedFieldsValid: () => boolean;
920
- /**
921
- * Validates the form group and all related children.
922
- */
923
- validate: (cause: ValidationCause, opts?: {
924
- skipFormValidation?: boolean;
925
- skipRelatedFieldValidation?: boolean;
926
- }) => ValidationError[] | Promise<ValidationError[]>;
927
- /**
928
- * @private
929
- */
930
- triggerOnChangeListener: () => void;
931
- /**
932
- * @private
933
- */
934
- triggerOnSubmitListener: () => void;
935
- handleSubmit(): Promise<void>;
936
- handleSubmit(submitMeta: TSubmitMeta): Promise<void>;
937
- /**
938
- * Handles the form submission, performs validation, and calls the appropriate onSubmit or onSubmitInvalid callbacks.
939
- */
940
- _handleSubmit: (submitMeta?: TSubmitMeta) => Promise<void>;
941
- }
942
- //#endregion
943
- //#region ../../node_modules/.pnpm/@tanstack+form-core@1.33.5/node_modules/@tanstack/form-core/dist/esm/types.d.ts
944
- type ValidationError = unknown;
945
- type ValidationSource = 'form' | 'field';
946
- /**
947
- * "server" is only intended for SSR/SSG validation and should not execute anything
948
- * @private
949
- */
950
- type ValidationCause = 'change' | 'blur' | 'submit' | 'mount' | 'server' | 'dynamic';
951
- /**
952
- * @private
953
- */
954
- type ListenerCause = 'change' | 'blur' | 'submit' | 'mount';
955
- /**
956
- * @private
957
- */
958
- type ValidationErrorMapKeys = `on${Capitalize<ValidationCause>}`;
959
- /**
960
- * @private
961
- */
962
- type ValidationErrorMap<TOnMountReturn = unknown, TOnChangeReturn = unknown, TOnChangeAsyncReturn = unknown, TOnBlurReturn = unknown, TOnBlurAsyncReturn = unknown, TOnSubmitReturn = unknown, TOnSubmitAsyncReturn = unknown, TOnDynamicReturn = unknown, TOnDynamicAsyncReturn = unknown, TOnServerReturn = unknown> = {
963
- onMount?: TOnMountReturn;
964
- onChange?: TOnChangeReturn | TOnChangeAsyncReturn;
965
- onBlur?: TOnBlurReturn | TOnBlurAsyncReturn;
966
- onSubmit?: TOnSubmitReturn | TOnSubmitAsyncReturn;
967
- onDynamic?: TOnDynamicReturn | TOnDynamicAsyncReturn;
968
- onServer?: TOnServerReturn;
969
- };
970
- /**
971
- * @private allows tracking the source of the errors in the error map
972
- */
973
- type ValidationErrorMapSource = {
974
- onMount?: ValidationSource;
975
- onChange?: ValidationSource;
976
- onBlur?: ValidationSource;
977
- onSubmit?: ValidationSource;
978
- onServer?: ValidationSource;
979
- onDynamic?: ValidationSource;
980
- };
981
- /**
982
- * @private
983
- */
984
- type FormValidationErrorMap<TFormData = unknown, TOnMountReturn = unknown, TOnChangeReturn = unknown, TOnChangeAsyncReturn = unknown, TOnBlurReturn = unknown, TOnBlurAsyncReturn = unknown, TOnSubmitReturn = unknown, TOnSubmitAsyncReturn = unknown, TOnDynamicReturn = unknown, TOnDynamicAsyncReturn = unknown, TOnServerReturn = unknown> = {
985
- onMount?: TOnMountReturn | GlobalFormValidationError<TFormData>;
986
- onChange?: TOnChangeReturn | TOnChangeAsyncReturn | GlobalFormValidationError<TFormData>;
987
- onBlur?: TOnBlurReturn | TOnBlurAsyncReturn | GlobalFormValidationError<TFormData>;
988
- onSubmit?: TOnSubmitReturn | TOnSubmitAsyncReturn | GlobalFormValidationError<TFormData>;
989
- onDynamic?: TOnDynamicReturn | TOnDynamicAsyncReturn | GlobalFormValidationError<TFormData>;
990
- onServer?: TOnServerReturn;
991
- };
992
- /**
993
- * @private
994
- *
995
- * @example
996
- * ```tsx
997
- * {
998
- * form: 'This form contains an error',
999
- * fields: {
1000
- * age: "Must be 13 or older to register"
1001
- * }
1002
- * }
1003
- * ````
1004
- */
1005
- type GlobalFormValidationError<TFormData> = {
1006
- form?: ValidationError;
1007
- fields: Partial<Record<DeepKeys<TFormData>, ValidationError>>;
1008
- };
1009
- type ExtractGlobalFormError<TFormError> = TFormError extends GlobalFormValidationError<any> ? TFormError['form'] : TFormError;
1010
- /**
1011
- * @private
1012
- */
1013
- interface UpdateMetaOptions {
1014
- /**
1015
- * @default false
1016
- */
1017
- dontUpdateMeta?: boolean;
1018
- /**
1019
- * @default false
1020
- */
1021
- dontValidate?: boolean;
1022
- /**
1023
- * @default false
1024
- */
1025
- dontRunListeners?: boolean;
1026
- }
1027
- /**
1028
- * @private
1029
- */
1030
- interface FormLikeAPI<TFormData, TSubmitMeta> {
1031
- /**
1032
- * Validates all fields using the correct handlers for a given validation cause.
1033
- */
1034
- validateAllFields: (cause: ValidationCause) => Promise<unknown[]>;
1035
- /**
1036
- * Validates the children of a specified array in the form starting from a given index until the end using the correct handlers for a given validation type.
1037
- */
1038
- validateArrayFieldsStartingFrom: <TField extends DeepKeysOfType<TFormData, any[]>>(field: TField, index: number, cause: ValidationCause) => Promise<unknown[]>;
1039
- /**
1040
- * Validates a specified field in the form using the correct handlers for a given validation type.
1041
- */
1042
- validateField: <TField extends DeepKeys<TFormData>>(field: TField, cause: ValidationCause) => unknown[] | Promise<unknown[]>;
1043
- /**
1044
- * Handles the form submission, performs validation, and calls the appropriate onSubmit or onSubmitInvalid callbacks.
1045
- */
1046
- handleSubmit(): Promise<void>;
1047
- handleSubmit(submitMeta: TSubmitMeta): Promise<void>;
1048
- /**
1049
- * Gets the value of the specified field.
1050
- */
1051
- getFieldValue: <TField extends DeepKeys<TFormData>>(field: TField) => DeepValue<TFormData, TField>;
1052
- /**
1053
- * Gets the metadata of the specified field.
1054
- */
1055
- getFieldMeta: <TField extends DeepKeys<TFormData>>(field: TField) => AnyFieldLikeMeta | undefined;
1056
- /**
1057
- * Updates the metadata of the specified field.
1058
- */
1059
- setFieldMeta: <TField extends DeepKeys<TFormData>>(field: TField, updater: Updater<AnyFieldLikeMetaBase>) => void;
1060
- /**
1061
- * Sets the value of the specified field and optionally updates the touched state.
1062
- */
1063
- setFieldValue: <TField extends DeepKeys<TFormData>>(field: TField, updater: Updater<DeepValue<TFormData, TField>>, opts?: UpdateMetaOptions) => void;
1064
- /**
1065
- * Delete the specified field. Also deletes all subfields if there are any.
1066
- */
1067
- deleteField: <TField extends DeepKeys<TFormData>>(field: TField) => void;
1068
- /**
1069
- * Pushes a value into an array field.
1070
- */
1071
- pushFieldValue: <TField extends DeepKeysOfType<TFormData, any[]>>(field: TField, value: DeepValue<TFormData, TField> extends any[] ? DeepValue<TFormData, TField>[number] : never, opts?: UpdateMetaOptions) => void;
1072
- /**
1073
- * Insert a value into an array field at the specified index.
1074
- */
1075
- insertFieldValue: <TField extends DeepKeysOfType<TFormData, any[]>>(field: TField, index: number, value: DeepValue<TFormData, TField> extends any[] ? DeepValue<TFormData, TField>[number] : never, opts?: UpdateMetaOptions) => Promise<void>;
1076
- /**
1077
- * Replaces a value into an array field at the specified index.
1078
- */
1079
- replaceFieldValue: <TField extends DeepKeysOfType<TFormData, any[]>>(field: TField, index: number, value: DeepValue<TFormData, TField> extends any[] ? DeepValue<TFormData, TField>[number] : never, opts?: UpdateMetaOptions) => Promise<void>;
1080
- /**
1081
- * Removes a value from an array field at the specified index.
1082
- */
1083
- removeFieldValue: <TField extends DeepKeysOfType<TFormData, any[]>>(field: TField, index: number, opts?: UpdateMetaOptions) => Promise<void>;
1084
- /**
1085
- * Swaps the values at the specified indices within an array field.
1086
- */
1087
- swapFieldValues: <TField extends DeepKeysOfType<TFormData, any[]>>(field: TField, index1: number, index2: number, opts?: UpdateMetaOptions) => void;
1088
- /**
1089
- * Moves the value at the first specified index to the second specified index within an array field.
1090
- */
1091
- moveFieldValues: <TField extends DeepKeysOfType<TFormData, any[]>>(field: TField, index1: number, index2: number, opts?: UpdateMetaOptions) => void;
1092
- /**
1093
- * Clear all values within an array field.
1094
- */
1095
- clearFieldValues: <TField extends DeepKeysOfType<TFormData, any[]>>(field: TField, opts?: UpdateMetaOptions) => void;
1096
- /**
1097
- * Resets the field value and meta to default state
1098
- */
1099
- resetField: <TField extends DeepKeys<TFormData>>(field: TField) => void;
1100
- }
1101
- type UnwrapFormAsyncValidateOrFnForInner<TValidateOrFn extends undefined | FormAsyncValidateOrFn<any>> = [TValidateOrFn] extends [FormValidateAsyncFn<any>] ? Awaited<ReturnType<TValidateOrFn>> : [TValidateOrFn] extends [StandardSchemaV1<infer TOut, any>] ? StandardBrandedSchemaV1<TOut> : undefined;
1102
- type UnwrapFieldAsyncValidateOrFn<TName extends string, TValidateOrFn extends undefined | FieldAsyncValidateOrFn<any, any, any> | FormGroupAsyncValidateOrFn<any, any>, TFormValidateOrFn extends undefined | FormAsyncValidateOrFn<any>> = ([TFormValidateOrFn] extends [StandardSchemaV1<any, infer TStandardOut>] ? TName extends keyof TStandardOut ? StandardSchemaV1Issue[] : undefined : undefined) | (UnwrapFormAsyncValidateOrFnForInner<TFormValidateOrFn> extends (infer TFormValidateVal) ? TFormValidateVal extends {
1103
- __standardSchemaV1: true;
1104
- } ? [DeepValue<TFormValidateVal, TName>] extends [never] ? undefined : StandardSchemaV1Issue[] : TFormValidateVal extends {
1105
- fields: any;
1106
- } ? TName extends keyof TFormValidateVal['fields'] ? TFormValidateVal['fields'][TName] : undefined : undefined : never) | ([TValidateOrFn] extends [FieldValidateAsyncFn<any, any, any>] ? Awaited<ReturnType<TValidateOrFn>> : [TValidateOrFn] extends [StandardSchemaV1<any, any>] ? StandardSchemaV1Issue[] : undefined) | ([TValidateOrFn] extends [FormGroupValidateAsyncFn<any, any, any>] ? Awaited<ReturnType<TValidateOrFn>> : [TValidateOrFn] extends [StandardSchemaV1<any, any>] ? StandardSchemaV1Issue[] : undefined);
1107
- /**
1108
- * @private
1109
- */
1110
- type FieldErrorMapFromValidator<TParentData, TName extends DeepKeys<TParentData>, TData extends DeepValue<TParentData, TName>, TOnMount extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnChange extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnChangeAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, TOnBlur extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnBlurAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, TOnSubmit extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnSubmitAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>> = Partial<Record<DeepKeys<TParentData>, ValidationErrorMap<TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync>>>;
1111
- type StandardBrandedSchemaV1<T> = T & {
1112
- __standardSchemaV1: true;
1113
- };
1114
- type UnwrapFormValidateOrFnForInner<TValidateOrFn extends undefined | FormValidateOrFn<any>> = [TValidateOrFn] extends [FormValidateFn<any>] ? ReturnType<TValidateOrFn> : [TValidateOrFn] extends [StandardSchemaV1<infer TOut, any>] ? StandardBrandedSchemaV1<TOut> : undefined;
1115
- type UnwrapFieldValidateOrFn<TName extends string, TValidateOrFn extends undefined | FieldValidateOrFn<any, any, any> | FormGroupValidateOrFn<any, any, any>, TFormValidateOrFn extends undefined | FormValidateOrFn<any>> = ([TFormValidateOrFn] extends [StandardSchemaV1<any, infer TStandardOut>] ? TName extends keyof TStandardOut ? StandardSchemaV1Issue[] : undefined : undefined) | (UnwrapFormValidateOrFnForInner<TFormValidateOrFn> extends (infer TFormValidateVal) ? TFormValidateVal extends {
1116
- __standardSchemaV1: true;
1117
- } ? [DeepValue<TFormValidateVal, TName>] extends [never] ? undefined : StandardSchemaV1Issue[] : TFormValidateVal extends {
1118
- fields: any;
1119
- } ? TName extends keyof TFormValidateVal['fields'] ? TFormValidateVal['fields'][TName] : undefined : undefined : never) | ([TValidateOrFn] extends [StandardSchemaV1<any, any>] ? StandardSchemaV1Issue[] : [TValidateOrFn] extends [FieldValidateFn<any, any, any>] ? ReturnType<TValidateOrFn> : undefined) | ([TValidateOrFn] extends [StandardSchemaV1<any, any>] ? StandardSchemaV1Issue[] : [TValidateOrFn] extends [FormGroupValidateFn<any, any, any>] ? ReturnType<TValidateOrFn> : undefined);
1120
- /**
1121
- * @private
1122
- */
1123
- type FieldLikeMetaBase<TParentData, TName extends DeepKeys<TParentData>, TData extends DeepValue<TParentData, TName>, TOnMount extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnChange extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnChangeAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, TOnBlur extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnBlurAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, TOnSubmit extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnSubmitAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, TOnDynamic extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnDynamicAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, TFormOnMount extends undefined | FormValidateOrFn<TParentData>, TFormOnChange extends undefined | FormValidateOrFn<TParentData>, TFormOnChangeAsync extends undefined | FormAsyncValidateOrFn<TParentData>, TFormOnBlur extends undefined | FormValidateOrFn<TParentData>, TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn<TParentData>, TFormOnSubmit extends undefined | FormValidateOrFn<TParentData>, TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TParentData>, TFormOnDynamic extends undefined | FormValidateOrFn<TParentData>, TFormOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TParentData>> = {
1124
- /**
1125
- * A flag indicating whether the field has been touched.
1126
- */
1127
- isTouched: boolean;
1128
- /**
1129
- * A flag indicating whether the field has been blurred.
1130
- */
1131
- isBlurred: boolean;
1132
- /**
1133
- * A flag that is `true` if the field's value has been modified by the user. Opposite of `isPristine`.
1134
- */
1135
- isDirty: boolean;
1136
- /**
1137
- * A map of errors related to the field value.
1138
- */
1139
- errorMap: ValidationErrorMap<UnwrapFieldValidateOrFn<TName, TOnMount, TFormOnMount>, UnwrapFieldValidateOrFn<TName, TOnChange, TFormOnChange>, UnwrapFieldAsyncValidateOrFn<TName, TOnChangeAsync, TFormOnChangeAsync>, UnwrapFieldValidateOrFn<TName, TOnBlur, TFormOnBlur>, UnwrapFieldAsyncValidateOrFn<TName, TOnBlurAsync, TFormOnBlurAsync>, UnwrapFieldValidateOrFn<TName, TOnSubmit, TFormOnSubmit>, UnwrapFieldAsyncValidateOrFn<TName, TOnSubmitAsync, TFormOnSubmitAsync>, UnwrapFieldValidateOrFn<TName, TOnDynamic, TFormOnDynamic>, UnwrapFieldAsyncValidateOrFn<TName, TOnDynamicAsync, TFormOnDynamicAsync>>;
1140
- /**
1141
- * @private allows tracking the source of the errors in the error map
1142
- */
1143
- errorSourceMap: ValidationErrorMapSource;
1144
- /**
1145
- * A flag indicating whether the field is currently being validated.
1146
- */
1147
- isValidating: boolean;
1148
- /**
1149
- * @private
1150
- * Counter for tracking active async validations to prevent race conditions
1151
- * when multiple validations finish at the same time.
1152
- *
1153
- * NOTE: This field is intentionally internal (prefixed with `_`) and is not
1154
- * part of the public API — do not read or rely on it from external code.
1155
- */
1156
- _pendingValidationsCount: number;
1157
- /**
1158
- * @private a counter that is incremented every time a structural array
1159
- * operation (push, insert, remove, swap, move, replace, clear) modifies
1160
- * the value of an array field. Adapters can subscribe to this to trigger
1161
- * re-renders for `mode="array"` fields without having to subscribe to the
1162
- * full field value.
1163
- */
1164
- _arrayVersion: number;
1165
- };
1166
- /**
1167
- * @private
1168
- */
1169
- type AnyFieldLikeMetaBase = FieldLikeMetaBase<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
1170
- /**
1171
- * @private
1172
- */
1173
- type FieldLikeMetaDerived<TParentData, TName extends DeepKeys<TParentData>, TData extends DeepValue<TParentData, TName>, TOnMount extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnChange extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnChangeAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, TOnBlur extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnBlurAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, TOnSubmit extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnSubmitAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, TOnDynamic extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnDynamicAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, TFormOnMount extends undefined | FormValidateOrFn<TParentData>, TFormOnChange extends undefined | FormValidateOrFn<TParentData>, TFormOnChangeAsync extends undefined | FormAsyncValidateOrFn<TParentData>, TFormOnBlur extends undefined | FormValidateOrFn<TParentData>, TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn<TParentData>, TFormOnSubmit extends undefined | FormValidateOrFn<TParentData>, TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TParentData>, TFormOnDynamic extends undefined | FormValidateOrFn<TParentData>, TFormOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TParentData>> = {
1174
- /**
1175
- * An array of errors related to the field value.
1176
- */
1177
- errors: Array<UnwrapOneLevelOfArray<UnwrapFieldValidateOrFn<TName, TOnMount, TFormOnMount>> | UnwrapOneLevelOfArray<UnwrapFieldValidateOrFn<TName, TOnChange, TFormOnChange>> | UnwrapOneLevelOfArray<UnwrapFieldAsyncValidateOrFn<TName, TOnChangeAsync, TFormOnChangeAsync>> | UnwrapOneLevelOfArray<UnwrapFieldValidateOrFn<TName, TOnBlur, TFormOnBlur>> | UnwrapOneLevelOfArray<UnwrapFieldAsyncValidateOrFn<TName, TOnBlurAsync, TFormOnBlurAsync>> | UnwrapOneLevelOfArray<UnwrapFieldValidateOrFn<TName, TOnSubmit, TFormOnSubmit>> | UnwrapOneLevelOfArray<UnwrapFieldAsyncValidateOrFn<TName, TOnSubmitAsync, TFormOnSubmitAsync>> | UnwrapOneLevelOfArray<UnwrapFieldValidateOrFn<TName, TOnDynamic, TFormOnDynamic>> | UnwrapOneLevelOfArray<UnwrapFieldAsyncValidateOrFn<TName, TOnDynamicAsync, TFormOnDynamicAsync>>>;
1178
- /**
1179
- * A flag that is `true` if the field's value has not been modified by the user. Opposite of `isDirty`.
1180
- */
1181
- isPristine: boolean;
1182
- /**
1183
- * A boolean indicating if the field is valid. Evaluates `true` if there are no field errors.
1184
- */
1185
- isValid: boolean;
1186
- /**
1187
- * A flag indicating whether the field's current value is the default value
1188
- */
1189
- isDefaultValue: boolean;
1190
- };
1191
- /**
1192
- * @private
1193
- * An object type representing the metadata of a field in a form.
1194
- */
1195
- type FieldLikeMeta<TParentData, TName extends DeepKeys<TParentData>, TData extends DeepValue<TParentData, TName>, TOnMount extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnChange extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnChangeAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, TOnBlur extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnBlurAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, TOnSubmit extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnSubmitAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, TOnDynamic extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnDynamicAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, TFormOnMount extends undefined | FormValidateOrFn<TParentData>, TFormOnChange extends undefined | FormValidateOrFn<TParentData>, TFormOnChangeAsync extends undefined | FormAsyncValidateOrFn<TParentData>, TFormOnBlur extends undefined | FormValidateOrFn<TParentData>, TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn<TParentData>, TFormOnSubmit extends undefined | FormValidateOrFn<TParentData>, TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TParentData>, TFormOnDynamic extends undefined | FormValidateOrFn<TParentData>, TFormOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TParentData>> = FieldLikeMetaBase<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync> & FieldLikeMetaDerived<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync>;
1196
- /**
1197
- * @private
1198
- */
1199
- type AnyFieldLikeMeta = FieldLikeMeta<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
1200
- /**
1201
- * @private
1202
- * An object type representing the state of a field.
1203
- */
1204
- type FieldLikeState<TParentData, TName extends DeepKeys<TParentData>, TData extends DeepValue<TParentData, TName>, TOnMount extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnChange extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnChangeAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, TOnBlur extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnBlurAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, TOnSubmit extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnSubmitAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, TOnDynamic extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, TOnDynamicAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, TFormOnMount extends undefined | FormValidateOrFn<TParentData>, TFormOnChange extends undefined | FormValidateOrFn<TParentData>, TFormOnChangeAsync extends undefined | FormAsyncValidateOrFn<TParentData>, TFormOnBlur extends undefined | FormValidateOrFn<TParentData>, TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn<TParentData>, TFormOnSubmit extends undefined | FormValidateOrFn<TParentData>, TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TParentData>, TFormOnDynamic extends undefined | FormValidateOrFn<TParentData>, TFormOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TParentData>> = {
1205
- /**
1206
- * The current value of the field.
1207
- */
1208
- value: TData;
1209
- /**
1210
- * The current metadata of the field.
1211
- */
1212
- meta: FieldLikeMeta<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync>;
1213
- };
1214
- /**
1215
- * @private
1216
- * An object type representing the options for a field in a form.
1217
- */
1218
- interface FieldLikeOptions<TParentData, TName extends DeepKeys<TParentData>, TData extends DeepValue<TParentData, TName>, in out TOnMount extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnChange extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnChangeAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnBlur extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnBlurAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnSubmit extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnSubmitAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnDynamic extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnDynamicAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>> {
1219
- /**
1220
- * The field name. The type will be `DeepKeys<TParentData>` to ensure your name is a deep key of the parent dataset.
1221
- */
1222
- name: TName;
1223
- /**
1224
- * An optional default value for the field.
1225
- */
1226
- defaultValue?: NoInfer<TData>;
1227
- /**
1228
- * The default time to debounce async validation if there is not a more specific debounce time passed.
1229
- */
1230
- asyncDebounceMs?: number;
1231
- /**
1232
- * If `true`, always run async validation, even if there are errors emitted during synchronous validation.
1233
- */
1234
- asyncAlways?: boolean;
1235
- /**
1236
- * An optional object with default metadata for the field.
1237
- */
1238
- defaultMeta?: Partial<FieldLikeMeta<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, any, any, any, any, any, any, any, any, any>>;
1239
- /**
1240
- * Disable the `flat(1)` operation on `field.errors`. This is useful if you want to keep the error structure as is. Not suggested for most use-cases.
1241
- */
1242
- disableErrorFlat?: boolean;
1243
- }
1244
- /**
1245
- * @private
1246
- * An object type representing the required options for the FieldApi class.
1247
- */
1248
- interface FieldLikeApiOptions<in out TParentData, in out TName extends DeepKeys<TParentData>, in out TData extends DeepValue<TParentData, TName>, in out TOnMount extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnChange extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnChangeAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnBlur extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnBlurAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnSubmit extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnSubmitAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnDynamic extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnDynamicAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TFormOnMount extends undefined | FormValidateOrFn<TParentData>, in out TFormOnChange extends undefined | FormValidateOrFn<TParentData>, in out TFormOnChangeAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnBlur extends undefined | FormValidateOrFn<TParentData>, in out TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnSubmit extends undefined | FormValidateOrFn<TParentData>, in out TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnDynamic extends undefined | FormValidateOrFn<TParentData>, in out TFormOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnServer extends undefined | FormAsyncValidateOrFn<TParentData>, in out TParentSubmitMeta> extends FieldLikeOptions<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync> {
1249
- form: FormApi<TParentData, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta>;
1250
- }
1251
- /**
1252
- * @private
1253
- */
1254
- interface FieldLikeAPI<in out TParentData, in out TName extends DeepKeys<TParentData>, in out TData extends DeepValue<TParentData, TName>, in out TOnMount extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnChange extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnChangeAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnBlur extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnBlurAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnSubmit extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnSubmitAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TOnDynamic extends undefined | FieldValidateOrFn<TParentData, TName, TData> | FormGroupValidateOrFn<TParentData, TName, TData>, in out TOnDynamicAsync extends undefined | FieldAsyncValidateOrFn<TParentData, TName, TData> | FormGroupAsyncValidateOrFn<TParentData, TName, TData>, in out TFormOnMount extends undefined | FormValidateOrFn<TParentData>, in out TFormOnChange extends undefined | FormValidateOrFn<TParentData>, in out TFormOnChangeAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnBlur extends undefined | FormValidateOrFn<TParentData>, in out TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnSubmit extends undefined | FormValidateOrFn<TParentData>, in out TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnDynamic extends undefined | FormValidateOrFn<TParentData>, in out TFormOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TParentData>, in out TFormOnServer extends undefined | FormAsyncValidateOrFn<TParentData>, in out TParentSubmitMeta, TExtraOptions = {}> {
1255
- form: AnyFormApi;
1256
- options: FieldLikeApiOptions<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta> & TExtraOptions;
1257
- store: ReadonlyStore<FieldLikeState<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync>>;
1258
- /**
1259
- * The field name.
1260
- */
1261
- name: TName;
1262
- mount: () => () => void;
1263
- setValue: (updater: Updater<TData>, options?: UpdateMetaOptions) => void;
1264
- getMeta: () => AnyFieldLikeMeta;
1265
- setMeta: (updater: Updater<AnyFieldLikeMetaBase>) => void;
1266
- getInfo: () => FieldInfo<TParentData>;
1267
- validate: (cause: ValidationCause, opts?: {
1268
- skipFormValidation?: boolean;
1269
- skipGroupValidation?: boolean;
1270
- }) => ValidationError[] | Promise<ValidationError[]>;
1271
- /**
1272
- * @private
1273
- */
1274
- triggerOnChangeListener: () => void;
1275
- /**
1276
- * @private
1277
- */
1278
- triggerOnSubmitListener: () => void;
1279
- }
1280
- /**
1281
- * @private
1282
- */
1283
- interface FieldInfo<TParentData> {
1284
- instance: FieldLikeAPI<TParentData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any> | null;
1285
- validationMetaMap: Record<ValidationErrorMapKeys, ValidationMeta | undefined>;
1286
- }
1287
- //#endregion
1288
- //#region ../../node_modules/.pnpm/@tanstack+form-core@1.33.5/node_modules/@tanstack/form-core/dist/esm/FormApi.d.ts
1289
- /**
1290
- * @private
1291
- */
1292
- type FormErrorMapFromValidator<TFormData, TOnMount extends undefined | FormValidateOrFn<TFormData>, TOnChange extends undefined | FormValidateOrFn<TFormData>, TOnChangeAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnBlur extends undefined | FormValidateOrFn<TFormData>, TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnSubmit extends undefined | FormValidateOrFn<TFormData>, TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnDynamic extends undefined | FormValidateOrFn<TFormData>, TOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TFormData>> = Partial<Record<DeepKeys<TFormData>, ValidationErrorMap<TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync>>>;
1293
- type FormValidateFn<TFormData> = (props: {
1294
- value: TFormData;
1295
- formApi: FormApi<TFormData, any, any, any, any, any, any, any, any, any, any, any>;
1296
- }) => unknown;
1297
- /**
1298
- * @private
1299
- */
1300
- type FormValidateOrFn<TFormData> = FormValidateFn<TFormData> | StandardSchemaV1<TFormData, unknown>;
1301
- type UnwrapFormValidateOrFn<TValidateOrFn extends undefined | FormValidateOrFn<any>> = [TValidateOrFn] extends [FormValidateFn<any>] ? ExtractGlobalFormError<ReturnType<TValidateOrFn>> : [TValidateOrFn] extends [StandardSchemaV1<any, any>] ? Record<string, StandardSchemaV1Issue[]> : undefined;
1302
- /**
1303
- * @private
1304
- */
1305
- type FormValidateAsyncFn<TFormData> = (props: {
1306
- value: TFormData;
1307
- formApi: FormApi<TFormData, any, any, any, any, any, any, any, any, any, any, any>;
1308
- signal: AbortSignal;
1309
- }) => unknown | Promise<unknown>;
1310
- /**
1311
- * @private
1312
- */
1313
- type FormAsyncValidateOrFn<TFormData> = FormValidateAsyncFn<TFormData> | StandardSchemaV1<TFormData, unknown>;
1314
- type UnwrapFormAsyncValidateOrFn<TValidateOrFn extends undefined | FormAsyncValidateOrFn<any>> = [TValidateOrFn] extends [FormValidateAsyncFn<any>] ? ExtractGlobalFormError<Awaited<ReturnType<TValidateOrFn>>> : [TValidateOrFn] extends [StandardSchemaV1<any, any>] ? Record<string, StandardSchemaV1Issue[]> : undefined;
1315
- interface FormValidators<TFormData, TOnMount extends undefined | FormValidateOrFn<TFormData>, TOnChange extends undefined | FormValidateOrFn<TFormData>, TOnChangeAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnBlur extends undefined | FormValidateOrFn<TFormData>, TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnSubmit extends undefined | FormValidateOrFn<TFormData>, TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnDynamic extends undefined | FormValidateOrFn<TFormData>, TOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TFormData>> {
1316
- /**
1317
- * Optional function that fires as soon as the component mounts.
1318
- */
1319
- onMount?: RejectPromiseValidator<TOnMount>;
1320
- /**
1321
- * Optional function that checks the validity of your data whenever a value changes
1322
- */
1323
- onChange?: RejectPromiseValidator<TOnChange>;
1324
- /**
1325
- * Optional onChange asynchronous counterpart to onChange. Useful for more complex validation logic that might involve server requests.
1326
- */
1327
- onChangeAsync?: TOnChangeAsync;
1328
- /**
1329
- * The default time in milliseconds that if set to a number larger than 0, will debounce the async validation event by this length of time in milliseconds.
1330
- */
1331
- onChangeAsyncDebounceMs?: number;
1332
- /**
1333
- * Optional function that validates the form data when a field loses focus, returns a `FormValidationError`
1334
- */
1335
- onBlur?: RejectPromiseValidator<TOnBlur>;
1336
- /**
1337
- * Optional onBlur asynchronous validation method for when a field loses focus returns a ` FormValidationError` or a promise of `Promise<FormValidationError>`
1338
- */
1339
- onBlurAsync?: TOnBlurAsync;
1340
- /**
1341
- * The default time in milliseconds that if set to a number larger than 0, will debounce the async validation event by this length of time in milliseconds.
1342
- */
1343
- onBlurAsyncDebounceMs?: number;
1344
- onSubmit?: RejectPromiseValidator<TOnSubmit>;
1345
- onSubmitAsync?: TOnSubmitAsync;
1346
- onDynamic?: RejectPromiseValidator<TOnDynamic>;
1347
- onDynamicAsync?: TOnDynamicAsync;
1348
- onDynamicAsyncDebounceMs?: number;
1349
- }
1350
- interface FormListenersPropsGroup<TFormData, TOnMount extends undefined | FormValidateOrFn<TFormData>, TOnChange extends undefined | FormValidateOrFn<TFormData>, TOnChangeAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnBlur extends undefined | FormValidateOrFn<TFormData>, TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnSubmit extends undefined | FormValidateOrFn<TFormData>, TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnDynamic extends undefined | FormValidateOrFn<TFormData>, TOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnServer extends undefined | FormAsyncValidateOrFn<TFormData>, TSubmitMeta = never> {
1351
- formApi: FormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>;
1352
- groupApi: AnyFormGroupApi;
1353
- }
1354
- interface FormListenersPropsField<TFormData, TOnMount extends undefined | FormValidateOrFn<TFormData>, TOnChange extends undefined | FormValidateOrFn<TFormData>, TOnChangeAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnBlur extends undefined | FormValidateOrFn<TFormData>, TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnSubmit extends undefined | FormValidateOrFn<TFormData>, TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnDynamic extends undefined | FormValidateOrFn<TFormData>, TOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnServer extends undefined | FormAsyncValidateOrFn<TFormData>, TSubmitMeta = never> {
1355
- formApi: FormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>;
1356
- fieldApi: AnyFieldApi;
1357
- }
1358
- interface FormListeners<TFormData, TOnMount extends undefined | FormValidateOrFn<TFormData>, TOnChange extends undefined | FormValidateOrFn<TFormData>, TOnChangeAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnBlur extends undefined | FormValidateOrFn<TFormData>, TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnSubmit extends undefined | FormValidateOrFn<TFormData>, TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnDynamic extends undefined | FormValidateOrFn<TFormData>, TOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnServer extends undefined | FormAsyncValidateOrFn<TFormData>, TSubmitMeta = never> {
1359
- onChange?: (props: FormListenersPropsField<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>) => void;
1360
- onChangeDebounceMs?: number;
1361
- onChangeGroup?: (props: FormListenersPropsGroup<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>) => void;
1362
- onChangeGroupDebounceMs?: number;
1363
- onBlur?: (props: {
1364
- formApi: FormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>;
1365
- fieldApi: AnyFieldApi;
1366
- }) => void;
1367
- onBlurDebounceMs?: number;
1368
- onMount?: (props: {
1369
- formApi: FormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>;
1370
- }) => void;
1371
- onSubmit?: (props: {
1372
- formApi: FormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>;
1373
- meta: TSubmitMeta;
1374
- }) => void;
1375
- onFieldUnmount?: (props: FormListenersPropsField<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>) => void;
1376
- onGroupUnmount?: (props: FormListenersPropsGroup<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>) => void;
1377
- }
1378
- /**
1379
- * An object representing the base properties of a form, unrelated to any validators
1380
- */
1381
- interface BaseFormOptions<in out TFormData, in out TSubmitMeta = never> {
1382
- /**
1383
- * Set initial values for your form.
1384
- */
1385
- defaultValues?: TFormData;
1386
- /**
1387
- * onSubmitMeta, the data passed from the handleSubmit handler, to the onSubmit function props
1388
- */
1389
- onSubmitMeta?: TSubmitMeta;
1390
- }
1391
- /**
1392
- * An object representing the options for a form.
1393
- */
1394
- interface FormOptions<in out TFormData, in out TOnMount extends undefined | FormValidateOrFn<TFormData>, in out TOnChange extends undefined | FormValidateOrFn<TFormData>, in out TOnChangeAsync extends undefined | FormAsyncValidateOrFn<TFormData>, in out TOnBlur extends undefined | FormValidateOrFn<TFormData>, in out TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>, in out TOnSubmit extends undefined | FormValidateOrFn<TFormData>, in out TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>, in out TOnDynamic extends undefined | FormValidateOrFn<TFormData>, in out TOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TFormData>, in out TOnServer extends undefined | FormAsyncValidateOrFn<TFormData>, in out TSubmitMeta = never> extends BaseFormOptions<TFormData, TSubmitMeta> {
1395
- /**
1396
- * The form name, used for devtools and identification
1397
- */
1398
- formId?: string;
1399
- /**
1400
- * The default state for the form.
1401
- */
1402
- defaultState?: Partial<FormState<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer>>;
1403
- /**
1404
- * If true, always run async validation, even when sync validation has produced an error. Defaults to undefined.
1405
- */
1406
- asyncAlways?: boolean;
1407
- /**
1408
- * Optional time in milliseconds if you want to introduce a delay before firing off an async action.
1409
- */
1410
- asyncDebounceMs?: number;
1411
- /**
1412
- * If true, allows the form to be submitted in an invalid state i.e. canSubmit will remain true regardless of validation errors. Defaults to undefined.
1413
- */
1414
- canSubmitWhenInvalid?: boolean;
1415
- /**
1416
- * A list of validators to pass to the form
1417
- */
1418
- validators?: FormValidators<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync>;
1419
- validationLogic?: ValidationLogicFn;
1420
- /**
1421
- * form level listeners
1422
- */
1423
- listeners?: FormListeners<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>;
1424
- /**
1425
- * A function to be called when the form is submitted, what should happen once the user submits a valid form returns `any` or a promise `Promise<any>`
1426
- */
1427
- onSubmit?: (props: {
1428
- value: TFormData;
1429
- formApi: FormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>;
1430
- meta: TSubmitMeta;
1431
- }) => any | Promise<any>;
1432
- /**
1433
- * Specify an action for scenarios where the user tries to submit an invalid form.
1434
- */
1435
- onSubmitInvalid?: (props: {
1436
- value: TFormData;
1437
- formApi: FormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>;
1438
- meta: TSubmitMeta;
1439
- }) => void;
1440
- transform?: (data: unknown) => unknown;
1441
- }
1442
- /**
1443
- * An object representing the validation metadata for a field. Not intended for public usage.
1444
- */
1445
- type ValidationMeta = {
1446
- /**
1447
- * An abort controller stored in memory to cancel previous async validation attempts.
1448
- */
1449
- lastAbortController: AbortController;
1450
- };
1451
- /**
1452
- * An object representing the current state of the form.
1453
- */
1454
- type BaseFormState<in out TFormData, in out TOnMount extends undefined | FormValidateOrFn<TFormData>, in out TOnChange extends undefined | FormValidateOrFn<TFormData>, in out TOnChangeAsync extends undefined | FormAsyncValidateOrFn<TFormData>, in out TOnBlur extends undefined | FormValidateOrFn<TFormData>, in out TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>, in out TOnSubmit extends undefined | FormValidateOrFn<TFormData>, in out TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>, in out TOnDynamic extends undefined | FormValidateOrFn<TFormData>, in out TOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TFormData>, in out TOnServer extends undefined | FormAsyncValidateOrFn<TFormData>> = {
1455
- /**
1456
- * The current values of the form fields.
1457
- */
1458
- values: TFormData;
1459
- /**
1460
- * The error map for the form itself.
1461
- */
1462
- errorMap: ValidationErrorMap<UnwrapFormValidateOrFn<TOnMount>, UnwrapFormValidateOrFn<TOnChange>, UnwrapFormAsyncValidateOrFn<TOnChangeAsync>, UnwrapFormValidateOrFn<TOnBlur>, UnwrapFormAsyncValidateOrFn<TOnBlurAsync>, UnwrapFormValidateOrFn<TOnSubmit>, UnwrapFormAsyncValidateOrFn<TOnSubmitAsync>, UnwrapFormValidateOrFn<TOnDynamic>, UnwrapFormAsyncValidateOrFn<TOnDynamicAsync>, UnwrapFormAsyncValidateOrFn<TOnServer>>;
1463
- /**
1464
- * An internal mechanism used for keeping track of validation logic in a form.
1465
- */
1466
- validationMetaMap: Record<ValidationErrorMapKeys, ValidationMeta | undefined>;
1467
- /**
1468
- * A record of field metadata for each field in the form, not including the derived properties, like `errors` and such
1469
- */
1470
- fieldMetaBase: Partial<Record<DeepKeys<TFormData>, AnyFieldLikeMetaBase>>;
1471
- /**
1472
- * A record of submission lifecycle state for each mounted `FormGroupApi`,
1473
- * keyed by the group's fully-qualified field name. Stored on the form so
1474
- * group-level state can be read from `FormApi` without having to walk the
1475
- * mounted group instances.
1476
- */
1477
- formGroupStateBase: Partial<Record<string, FormGroupState>>;
1478
- /**
1479
- * A boolean indicating if the form is currently in the process of being submitted after `handleSubmit` is called.
1480
- *
1481
- * Goes back to `false` when submission completes for one of the following reasons:
1482
- * - the validation step returned errors.
1483
- * - the `onSubmit` function has completed.
1484
- *
1485
- * Note: if you're running async operations in your `onSubmit` function make sure to await them to ensure `isSubmitting` is set to `false` only when the async operation completes.
1486
- *
1487
- * This is useful for displaying loading indicators or disabling form inputs during submission.
1488
- *
1489
- */
1490
- isSubmitting: boolean;
1491
- /**
1492
- * A boolean indicating if the `onSubmit` function has completed successfully.
1493
- *
1494
- * Goes back to `false` at each new submission attempt.
1495
- *
1496
- * Note: you can use isSubmitting to check if the form is currently submitting.
1497
- */
1498
- isSubmitted: boolean;
1499
- /**
1500
- * A boolean indicating if the form or any of its fields are currently validating.
1501
- */
1502
- isValidating: boolean;
1503
- /**
1504
- * A counter for tracking the number of submission attempts.
1505
- */
1506
- submissionAttempts: number;
1507
- /**
1508
- * A boolean indicating if the last submission was successful.
1509
- */
1510
- isSubmitSuccessful: boolean;
1511
- /**
1512
- * @private, used to force a re-evaluation of the form state when options change
1513
- */
1514
- _force_re_eval?: boolean;
1515
- };
1516
- type DerivedFormState<in out TFormData, in out TOnMount extends undefined | FormValidateOrFn<TFormData>, in out TOnChange extends undefined | FormValidateOrFn<TFormData>, in out TOnChangeAsync extends undefined | FormAsyncValidateOrFn<TFormData>, in out TOnBlur extends undefined | FormValidateOrFn<TFormData>, in out TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>, in out TOnSubmit extends undefined | FormValidateOrFn<TFormData>, in out TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>, in out TOnDynamic extends undefined | FormValidateOrFn<TFormData>, in out TOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TFormData>, in out TOnServer extends undefined | FormAsyncValidateOrFn<TFormData>> = {
1517
- /**
1518
- * A boolean indicating if the form is currently validating.
1519
- */
1520
- isFormValidating: boolean;
1521
- /**
1522
- * A boolean indicating if the form is valid.
1523
- */
1524
- isFormValid: boolean;
1525
- /**
1526
- * The error array for the form itself.
1527
- */
1528
- errors: Array<NonNullable<UnwrapFormValidateOrFn<TOnMount> | UnwrapFormValidateOrFn<TOnChange> | UnwrapFormAsyncValidateOrFn<TOnChangeAsync> | UnwrapFormValidateOrFn<TOnBlur> | UnwrapFormAsyncValidateOrFn<TOnBlurAsync> | UnwrapFormValidateOrFn<TOnSubmit> | UnwrapFormAsyncValidateOrFn<TOnSubmitAsync> | UnwrapFormValidateOrFn<TOnDynamic> | UnwrapFormAsyncValidateOrFn<TOnDynamicAsync> | UnwrapFormAsyncValidateOrFn<TOnServer>>>;
1529
- /**
1530
- * A boolean indicating if any of the form fields are currently validating.
1531
- */
1532
- isFieldsValidating: boolean;
1533
- /**
1534
- * A boolean indicating if all the form fields are valid. Evaluates `true` if there are no field errors.
1535
- */
1536
- isFieldsValid: boolean;
1537
- /**
1538
- * A boolean indicating if any of the form fields have been touched.
1539
- */
1540
- isTouched: boolean;
1541
- /**
1542
- * A boolean indicating if any of the form fields have been blurred.
1543
- */
1544
- isBlurred: boolean;
1545
- /**
1546
- * A boolean indicating if any of the form's fields' values have been modified by the user. Evaluates `true` if the user have modified at least one of the fields. Opposite of `isPristine`.
1547
- */
1548
- isDirty: boolean;
1549
- /**
1550
- * A boolean indicating if none of the form's fields' values have been modified by the user. Evaluates `true` if the user have not modified any of the fields. Opposite of `isDirty`.
1551
- */
1552
- isPristine: boolean;
1553
- /**
1554
- * A boolean indicating if all of the form's fields are the same as default values.
1555
- */
1556
- isDefaultValue: boolean;
1557
- /**
1558
- * A boolean indicating if the form and all its fields are valid. Evaluates `true` if there are no errors.
1559
- */
1560
- isValid: boolean;
1561
- /**
1562
- * A boolean indicating if the form can be submitted based on its current state.
1563
- */
1564
- canSubmit: boolean;
1565
- /**
1566
- * A record of field metadata for each field in the form.
1567
- */
1568
- fieldMeta: Partial<Record<DeepKeys<TFormData>, AnyFieldLikeMeta>>;
1569
- };
1570
- interface FormState<in out TFormData, in out TOnMount extends undefined | FormValidateOrFn<TFormData>, in out TOnChange extends undefined | FormValidateOrFn<TFormData>, in out TOnChangeAsync extends undefined | FormAsyncValidateOrFn<TFormData>, in out TOnBlur extends undefined | FormValidateOrFn<TFormData>, in out TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>, in out TOnSubmit extends undefined | FormValidateOrFn<TFormData>, in out TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>, in out TOnDynamic extends undefined | FormValidateOrFn<TFormData>, in out TOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TFormData>, in out TOnServer extends undefined | FormAsyncValidateOrFn<TFormData>> extends BaseFormState<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer>, DerivedFormState<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer> {}
1571
- /**
1572
- * @public
1573
- *
1574
- * A type representing the Form API with all generics set to `any` for convenience.
1575
- */
1576
- type AnyFormApi = FormApi<any, any, any, any, any, any, any, any, any, any, any, any>;
1577
- interface ValidateOpts<TFormData> {
1578
- dontUpdateFormErrorMap?: boolean;
1579
- filterFieldNames?: (fieldName: DeepKeys<TFormData>) => boolean;
1580
- group?: AnyFormGroupApi;
1581
- }
1582
- /**
1583
- * We cannot use methods and must use arrow functions. Otherwise, our React adapters
1584
- * will break due to loss of the method when using spread.
1585
- */
1586
- /**
1587
- * A class representing the Form API. It handles the logic and interactions with the form state.
1588
- *
1589
- * Normally, you will not need to create a new `FormApi` instance directly. Instead, you will use a framework
1590
- * hook/function like `useForm` or `createForm` to create a new instance for you that uses your framework's reactivity model.
1591
- * However, if you need to create a new instance manually, you can do so by calling the `new FormApi` constructor.
1592
- */
1593
- declare class FormApi<in out TFormData, in out TOnMount extends undefined | FormValidateOrFn<TFormData>, in out TOnChange extends undefined | FormValidateOrFn<TFormData>, in out TOnChangeAsync extends undefined | FormAsyncValidateOrFn<TFormData>, in out TOnBlur extends undefined | FormValidateOrFn<TFormData>, in out TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>, in out TOnSubmit extends undefined | FormValidateOrFn<TFormData>, in out TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>, in out TOnDynamic extends undefined | FormValidateOrFn<TFormData>, in out TOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TFormData>, in out TOnServer extends undefined | FormAsyncValidateOrFn<TFormData>, in out TSubmitMeta = never> implements FormLikeAPI<TFormData, TSubmitMeta> {
1594
- /**
1595
- * The options for the form.
1596
- */
1597
- options: FormOptions<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>;
1598
- baseStore: Store<BaseFormState<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer>>;
1599
- fieldMetaDerived: Store<FormState<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer>['fieldMeta']>;
1600
- /**
1601
- * A derived store of every mounted `FormGroupApi`'s `meta`, keyed by
1602
- * group name. Mirrors `fieldMetaDerived` for fields: per-group `meta`
1603
- * is computed once on the form (from `baseStore.formGroupStateBase`,
1604
- * `fieldMetaDerived`, and the registered `formGroupApis`) so reads
1605
- * from a `FormGroupApi.store` instance stay minimal.
1606
- */
1607
- formGroupMetaDerived: ReadonlyStore<Record<string, AnyFormGroupMeta>>;
1608
- store: ReadonlyStore<FormState<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer>>;
1609
- /**
1610
- * A record of field information for each field in the form.
1611
- */
1612
- fieldInfo: Partial<Record<DeepKeys<TFormData>, FieldInfo<TFormData>>>;
1613
- /**
1614
- * The set of currently-mounted `FormGroupApi` instances belonging to
1615
- * this form. Used by `FieldApi.validate` to cascade field-level changes
1616
- * into the validators of any group that encompasses the field.
1617
- */
1618
- formGroupApis: Set<AnyFormGroupApi>;
1619
- get state(): FormState<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer>;
1620
- /**
1621
- * @private
1622
- */
1623
- timeoutIds: {
1624
- validations: Record<ValidationCause, ReturnType<typeof setTimeout> | null>;
1625
- listeners: Record<ListenerCause, ReturnType<typeof setTimeout> | null>;
1626
- formListeners: Record<ListenerCause, ReturnType<typeof setTimeout> | null>;
1627
- };
1628
- /**
1629
- * @private
1630
- */
1631
- _formId: string;
1632
- /**
1633
- * @private
1634
- */
1635
- private _devtoolsSubmissionOverride;
1636
- /**
1637
- * Constructs a new `FormApi` instance with the given form options.
1638
- */
1639
- constructor(opts?: FormOptions<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>);
1640
- get formId(): string;
1641
- /**
1642
- * @private
1643
- */
1644
- runValidator<TValue extends TStandardSchemaValidatorValue<TFormData> & {
1645
- formApi: AnyFormApi;
1646
- }, TType extends 'validate' | 'validateAsync'>(props: {
1647
- validate: TType extends 'validate' ? FormValidateOrFn<TFormData> : FormAsyncValidateOrFn<TFormData>;
1648
- value: TValue;
1649
- type: TType;
1650
- }): unknown;
1651
- mount: () => () => void;
1652
- /**
1653
- * Updates the form options and form state.
1654
- */
1655
- update: (options?: FormOptions<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>) => void;
1656
- /**
1657
- * Resets the form state to the default values.
1658
- * If values are provided, the form will be reset to those values instead and the default values will be updated.
1659
- *
1660
- * @param values - Optional values to reset the form to.
1661
- * @param opts - Optional options to control the reset behavior.
1662
- */
1663
- reset: (values?: TFormData, opts?: {
1664
- keepDefaultValues?: boolean;
1665
- }) => void;
1666
- /**
1667
- * Validates all fields according to the FIELD level validators.
1668
- * This will ignore FORM level validators, use form.validate({ValidationCause}) for a complete validation
1669
- */
1670
- validateAllFields: (cause: ValidationCause) => Promise<unknown[]>;
1671
- /**
1672
- * Validates the children of a specified array in the form starting from a given index until the end using the correct handlers for a given validation type.
1673
- */
1674
- validateArrayFieldsStartingFrom: <TField extends DeepKeysOfType<TFormData, any[]>>(field: TField, index: number, cause: ValidationCause) => Promise<unknown[]>;
1675
- /**
1676
- * Validates a specified field in the form using the correct handlers for a given validation type.
1677
- */
1678
- validateField: <TField extends DeepKeys<TFormData>>(field: TField, cause: ValidationCause) => any[] | Promise<any[]>;
1679
- /**
1680
- * TODO: This code is copied from FieldApi, we should refactor to share
1681
- * @private
1682
- */
1683
- validateSync: (cause: ValidationCause, validateOpts?: ValidateOpts<TFormData>) => {
1684
- hasErrored: boolean;
1685
- fieldsErrorMap: FormErrorMapFromValidator<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync>;
1686
- };
1687
- /**
1688
- * @private
1689
- */
1690
- validateAsync: (cause: ValidationCause, validateOpts?: ValidateOpts<TFormData>) => Promise<FormErrorMapFromValidator<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync>>;
1691
- /**
1692
- * @private
1693
- */
1694
- validate: (cause: ValidationCause, validateOpts?: ValidateOpts<TFormData>) => FormErrorMapFromValidator<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync> | Promise<FormErrorMapFromValidator<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync>>;
1695
- handleSubmit(): Promise<void>;
1696
- handleSubmit(submitMeta: TSubmitMeta): Promise<void>;
1697
- /**
1698
- * Handles the form submission, performs validation, and calls the appropriate onSubmit or onSubmitInvalid callbacks.
1699
- */
1700
- _handleSubmit: (submitMeta?: TSubmitMeta) => Promise<void>;
1701
- /**
1702
- * Gets the value of the specified field.
1703
- */
1704
- getFieldValue: <TField extends DeepKeys<TFormData>>(field: TField) => DeepValue<TFormData, TField>;
1705
- /**
1706
- * Gets the metadata of the specified field.
1707
- */
1708
- getFieldMeta: <TField extends DeepKeys<TFormData>>(field: TField) => AnyFieldLikeMeta | undefined;
1709
- /**
1710
- * Gets the derived `meta` of the form group registered at the given
1711
- * name. Mirrors `getFieldMeta` for fields. Returns `undefined` if no
1712
- * `FormGroupApi` with that name is currently mounted.
1713
- */
1714
- getFormGroupMeta: (name: string) => AnyFormGroupMeta | undefined;
1715
- /**
1716
- * Gets the field info of the specified field.
1717
- */
1718
- getFieldInfo: <TField extends DeepKeys<TFormData>>(field: TField) => FieldInfo<TFormData>;
1719
- /**
1720
- * Updates the metadata of the specified field.
1721
- */
1722
- setFieldMeta: <TField extends DeepKeys<TFormData>>(field: TField, updater: Updater<AnyFieldLikeMetaBase>) => void;
1723
- /**
1724
- * resets every field's meta
1725
- */
1726
- resetFieldMeta: <TField extends DeepKeys<TFormData>>(fieldMeta: Partial<Record<TField, AnyFieldLikeMeta>>) => Partial<Record<TField, AnyFieldLikeMeta>>;
1727
- /**
1728
- * Sets the value of the specified field and optionally updates the touched state.
1729
- */
1730
- setFieldValue: <TField extends DeepKeys<TFormData>>(field: TField, updater: Updater<DeepValue<TFormData, TField>>, opts?: UpdateMetaOptions) => void;
1731
- deleteField: <TField extends DeepKeys<TFormData>>(field: TField) => void;
1732
- /**
1733
- * Pushes a value into an array field.
1734
- */
1735
- pushFieldValue: <TField extends DeepKeysOfType<TFormData, any[]>>(field: TField, value: DeepValue<TFormData, TField> extends any[] ? DeepValue<TFormData, TField>[number] : never, options?: UpdateMetaOptions) => void;
1736
- insertFieldValue: <TField extends DeepKeysOfType<TFormData, any[]>>(field: TField, index: number, value: DeepValue<TFormData, TField> extends any[] ? DeepValue<TFormData, TField>[number] : never, options?: UpdateMetaOptions) => Promise<void>;
1737
- /**
1738
- * Replaces a value into an array field at the specified index.
1739
- */
1740
- replaceFieldValue: <TField extends DeepKeysOfType<TFormData, any[]>>(field: TField, index: number, value: DeepValue<TFormData, TField> extends any[] ? DeepValue<TFormData, TField>[number] : never, options?: UpdateMetaOptions) => Promise<void>;
1741
- /**
1742
- * Removes a value from an array field at the specified index.
1743
- */
1744
- removeFieldValue: <TField extends DeepKeysOfType<TFormData, any[]>>(field: TField, index: number, options?: UpdateMetaOptions) => Promise<void>;
1745
- /**
1746
- * Swaps the values at the specified indices within an array field.
1747
- */
1748
- swapFieldValues: <TField extends DeepKeysOfType<TFormData, any[]>>(field: TField, index1: number, index2: number, options?: UpdateMetaOptions) => void;
1749
- /**
1750
- * Moves the value at the first specified index to the second specified index within an array field.
1751
- */
1752
- moveFieldValues: <TField extends DeepKeysOfType<TFormData, any[]>>(field: TField, index1: number, index2: number, options?: UpdateMetaOptions) => void;
1753
- /**
1754
- * Clear all values within an array field.
1755
- */
1756
- clearFieldValues: <TField extends DeepKeysOfType<TFormData, any[]>>(field: TField, options?: UpdateMetaOptions) => void;
1757
- /**
1758
- * Resets the field value and meta to default state
1759
- */
1760
- resetField: <TField extends DeepKeys<TFormData>>(field: TField) => void;
1761
- /**
1762
- * Updates the form's errorMap
1763
- */
1764
- setErrorMap: (errorMap: FormValidationErrorMap<TFormData, UnwrapFormValidateOrFn<TOnMount>, UnwrapFormValidateOrFn<TOnChange>, UnwrapFormAsyncValidateOrFn<TOnChangeAsync>, UnwrapFormValidateOrFn<TOnBlur>, UnwrapFormAsyncValidateOrFn<TOnBlurAsync>, UnwrapFormValidateOrFn<TOnSubmit>, UnwrapFormAsyncValidateOrFn<TOnSubmitAsync>, UnwrapFormValidateOrFn<TOnDynamic>, UnwrapFormAsyncValidateOrFn<TOnDynamicAsync>, UnwrapFormAsyncValidateOrFn<TOnServer>>) => void;
1765
- /**
1766
- * Returns form and field level errors
1767
- */
1768
- getAllErrors: () => {
1769
- form: {
1770
- errors: Array<NonNullable<UnwrapFormValidateOrFn<TOnMount> | UnwrapFormValidateOrFn<TOnChange> | UnwrapFormAsyncValidateOrFn<TOnChangeAsync> | UnwrapFormValidateOrFn<TOnBlur> | UnwrapFormAsyncValidateOrFn<TOnBlurAsync> | UnwrapFormValidateOrFn<TOnSubmit> | UnwrapFormAsyncValidateOrFn<TOnSubmitAsync> | UnwrapFormValidateOrFn<TOnDynamic> | UnwrapFormAsyncValidateOrFn<TOnDynamicAsync> | UnwrapFormAsyncValidateOrFn<TOnServer>>>;
1771
- errorMap: ValidationErrorMap<UnwrapFormValidateOrFn<TOnMount>, UnwrapFormValidateOrFn<TOnChange>, UnwrapFormAsyncValidateOrFn<TOnChangeAsync>, UnwrapFormValidateOrFn<TOnBlur>, UnwrapFormAsyncValidateOrFn<TOnBlurAsync>, UnwrapFormValidateOrFn<TOnSubmit>, UnwrapFormAsyncValidateOrFn<TOnSubmitAsync>, UnwrapFormValidateOrFn<TOnDynamic>, UnwrapFormAsyncValidateOrFn<TOnDynamicAsync>, UnwrapFormAsyncValidateOrFn<TOnServer>>;
1772
- };
1773
- fields: Record<DeepKeys<TFormData>, {
1774
- errors: ValidationError[];
1775
- errorMap: ValidationErrorMap;
1776
- }>;
1777
- };
1778
- /**
1779
- * Parses the form's values with a given standard schema and returns
1780
- * issues (if any). This method does NOT set any internal errors.
1781
- * @param schema The standard schema to parse the form values with.
1782
- */
1783
- parseValuesWithSchema: (schema: StandardSchemaV1<TFormData, unknown>) => {
1784
- form: Record<string, StandardSchemaV1Issue[]>;
1785
- fields: Record<string, StandardSchemaV1Issue[]>;
1786
- } | undefined;
1787
- /**
1788
- * Parses the form's values with a given standard schema and returns
1789
- * issues (if any). This method does NOT set any internal errors.
1790
- * @param schema The standard schema to parse the form values with.
1791
- */
1792
- parseValuesWithSchemaAsync: (schema: StandardSchemaV1<TFormData, unknown>) => Promise<{
1793
- form: Record<string, StandardSchemaV1Issue[]>;
1794
- fields: Record<string, StandardSchemaV1Issue[]>;
1795
- } | undefined>;
1796
- }
1797
- //#endregion
1798
- //#region ../../node_modules/.pnpm/@tanstack+devtools-event-client@0.4.4/node_modules/@tanstack/devtools-event-client/dist/esm/plugin.d.ts
1799
- declare global {
1800
- var __TANSTACK_EVENT_TARGET__: EventTarget | null;
1801
- }
1802
- //#endregion
1803
- //#region src/components/form/index.d.ts
1804
- /** The engine owns the values and the validation; these two are the
1805
- * assembly — one grid, one error routing. */
1806
- declare const Form: import("svelte").Component<FormProps, {}, ""> & {
1807
- Root: import("svelte").Component<FormProps, {}, "">;
1808
- };
1809
- declare const FormField: import("svelte").Component<FormFieldProps, {}, ""> & {
1810
- Root: import("svelte").Component<FormFieldProps, {}, "">;
1811
- };
1812
- //#endregion
1813
- export { createForm as a, FormApi as c, FormProps as d, AnyFormApi$1 as f, createField as i, FieldApi as l, FormField as n, useField as o, SvelteFormApi as r, useForm as s, Form as t, FormFieldProps as u };