@formisch/qwik 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/index.d.ts +277 -72
- package/dist/index.qwik.js +114 -25
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -64,7 +64,11 @@ In addition, Formisch offers several functions (we call them "methods") that can
|
|
|
64
64
|
|
|
65
65
|
## Comparison
|
|
66
66
|
|
|
67
|
-
What makes Formisch unique is its framework-agnostic core, which is fully native to the framework you are using. It works by inserting framework-specific reactivity blocks when the core package is built
|
|
67
|
+
What makes Formisch unique is its framework-agnostic core, which is fully native to the framework you are using. It works by inserting framework-specific reactivity blocks when the core package is built, giving you native performance for any UI update. A modular methods API keeps bundles starting at just ~2.5 kB by only including the methods you import, and end-to-end type safety covers deeply nested paths and field arrays with TypeScript inference that stays fast even as forms grow.
|
|
68
|
+
|
|
69
|
+
## Vision
|
|
70
|
+
|
|
71
|
+
My vision for Formisch is to create a framework-agnostic platform similar to [Vite](https://vite.dev/), but for forms — a shared core that lets the same mental model and codebase work natively across every modern UI framework.
|
|
68
72
|
|
|
69
73
|
## Partners
|
|
70
74
|
|
package/dist/index.d.ts
CHANGED
|
@@ -4,13 +4,38 @@ import * as _qwik_dev_core_internal0 from "@qwik.dev/core/internal";
|
|
|
4
4
|
|
|
5
5
|
//#region ../../packages/core/dist/index.qwik.d.ts
|
|
6
6
|
|
|
7
|
-
//#region src/types/schema.d.ts
|
|
7
|
+
//#region src/types/schema/schema.d.ts
|
|
8
8
|
/**
|
|
9
9
|
* Schema type.
|
|
10
10
|
*/
|
|
11
11
|
type Schema = v.GenericSchema | v.GenericSchemaAsync;
|
|
12
|
+
/**
|
|
13
|
+
* Object schema type.
|
|
14
|
+
*/
|
|
15
|
+
type ObjectSchema = v.LooseObjectSchema<v.ObjectEntries, v.ErrorMessage<v.LooseObjectIssue> | undefined> | v.ObjectSchema<v.ObjectEntries, v.ErrorMessage<v.ObjectIssue> | undefined> | v.StrictObjectSchema<v.ObjectEntries, v.ErrorMessage<v.StrictObjectIssue> | undefined> | v.VariantSchema<string, v.VariantOptions<string>, v.ErrorMessage<v.VariantIssue> | undefined>;
|
|
16
|
+
/**
|
|
17
|
+
* Object schema async type.
|
|
18
|
+
*/
|
|
19
|
+
type ObjectSchemaAsync = v.LooseObjectSchemaAsync<v.ObjectEntriesAsync, v.ErrorMessage<v.LooseObjectIssue> | undefined> | v.ObjectSchemaAsync<v.ObjectEntriesAsync, v.ErrorMessage<v.ObjectIssue> | undefined> | v.StrictObjectSchemaAsync<v.ObjectEntriesAsync, v.ErrorMessage<v.StrictObjectIssue> | undefined> | v.VariantSchemaAsync<string, v.VariantOptionsAsync<string>, v.ErrorMessage<v.VariantIssue> | undefined>;
|
|
20
|
+
/**
|
|
21
|
+
* Object root schema type.
|
|
22
|
+
*/
|
|
23
|
+
type ObjectRootSchema = ObjectSchema | v.IntersectSchema<ObjectSchema[], v.ErrorMessage<v.IntersectIssue> | undefined> | v.UnionSchema<ObjectSchema[], v.ErrorMessage<v.UnionIssue<v.BaseIssue<unknown>>> | undefined>;
|
|
24
|
+
/**
|
|
25
|
+
* Object root schema async type.
|
|
26
|
+
*/
|
|
27
|
+
type ObjectRootSchemaAsync = ObjectSchemaAsync | v.IntersectSchemaAsync<(ObjectSchema | ObjectSchemaAsync)[], v.ErrorMessage<v.IntersectIssue> | undefined> | v.UnionSchemaAsync<(ObjectSchema | ObjectSchemaAsync)[], v.ErrorMessage<v.UnionIssue<v.BaseIssue<unknown>>> | undefined>;
|
|
28
|
+
/**
|
|
29
|
+
* Form schema type.
|
|
30
|
+
*
|
|
31
|
+
* Hint: Forms must have an object root, so only object schemas (sync or async),
|
|
32
|
+
* combinators (intersect, union, variant) whose options resolve to objects, and
|
|
33
|
+
* `lazy` schemas wrapping any of these are allowed at the top level. Use
|
|
34
|
+
* {@link Schema} for nested field schemas.
|
|
35
|
+
*/
|
|
36
|
+
type FormSchema = ObjectRootSchema | ObjectRootSchemaAsync | v.LazySchema<ObjectRootSchema> | v.LazySchemaAsync<ObjectRootSchema | ObjectRootSchemaAsync>;
|
|
12
37
|
//#endregion
|
|
13
|
-
//#region src/types/signal.d.ts
|
|
38
|
+
//#region src/types/signal/signal.d.ts
|
|
14
39
|
/**
|
|
15
40
|
* Signal interface.
|
|
16
41
|
*/
|
|
@@ -25,13 +50,13 @@ interface Signal<T> {
|
|
|
25
50
|
*/
|
|
26
51
|
|
|
27
52
|
//#endregion
|
|
28
|
-
//#region src/types/field.d.ts
|
|
53
|
+
//#region src/types/field/field.d.ts
|
|
29
54
|
/**
|
|
30
55
|
* Field element type.
|
|
31
56
|
*/
|
|
32
57
|
type FieldElement = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
|
|
33
58
|
//#endregion
|
|
34
|
-
//#region src/types/field.qwik.d.ts
|
|
59
|
+
//#region src/types/field/field.qwik.d.ts
|
|
35
60
|
/**
|
|
36
61
|
* Internal base store interface.
|
|
37
62
|
*/
|
|
@@ -197,7 +222,7 @@ type InternalFieldStore = InternalArrayStore | InternalObjectStore | InternalVal
|
|
|
197
222
|
*/
|
|
198
223
|
declare const INTERNAL: "~internal";
|
|
199
224
|
//#endregion
|
|
200
|
-
//#region src/types/utils.d.ts
|
|
225
|
+
//#region src/types/utils/utils.d.ts
|
|
201
226
|
/**
|
|
202
227
|
* Checks if a type is `any`.
|
|
203
228
|
*/
|
|
@@ -223,7 +248,7 @@ type DeepPartial<TValue> = TValue extends Record<PropertyKey, unknown> | readonl
|
|
|
223
248
|
*/
|
|
224
249
|
type PartialValues<TValue> = TValue extends readonly (infer TItem)[] ? number extends TValue["length"] ? (TItem extends Record<PropertyKey, unknown> | readonly unknown[] ? { [TKey in keyof TItem]: PartialValues<TItem[TKey]> } : TItem)[] : { [TKey in keyof TValue]: PartialValues<TValue[TKey]> } : TValue extends Record<PropertyKey, unknown> ? { [TKey in keyof TValue]: PartialValues<TValue[TKey]> } : TValue | undefined;
|
|
225
250
|
//#endregion
|
|
226
|
-
//#region src/types/form.d.ts
|
|
251
|
+
//#region src/types/form/form.d.ts
|
|
227
252
|
/**
|
|
228
253
|
* Validation mode type.
|
|
229
254
|
*/
|
|
@@ -231,17 +256,17 @@ type ValidationMode = "initial" | "touch" | "input" | "change" | "blur" | "submi
|
|
|
231
256
|
/**
|
|
232
257
|
* Submit handler type.
|
|
233
258
|
*/
|
|
234
|
-
type SubmitHandler<TSchema extends
|
|
259
|
+
type SubmitHandler<TSchema extends FormSchema> = (output: v.InferOutput<TSchema>) => MaybePromise<unknown>;
|
|
235
260
|
/**
|
|
236
261
|
* Submit event handler type.
|
|
237
262
|
*/
|
|
238
|
-
type SubmitEventHandler<TSchema extends
|
|
263
|
+
type SubmitEventHandler<TSchema extends FormSchema> = (output: v.InferOutput<TSchema>, event: SubmitEvent) => MaybePromise<unknown>;
|
|
239
264
|
//#endregion
|
|
240
|
-
//#region src/types/form.qwik.d.ts
|
|
265
|
+
//#region src/types/form/form.qwik.d.ts
|
|
241
266
|
/**
|
|
242
267
|
* Form config interface.
|
|
243
268
|
*/
|
|
244
|
-
interface FormConfig<TSchema extends
|
|
269
|
+
interface FormConfig<TSchema extends FormSchema = FormSchema> {
|
|
245
270
|
/**
|
|
246
271
|
* The schema of the form.
|
|
247
272
|
*/
|
|
@@ -262,7 +287,7 @@ interface FormConfig<TSchema extends Schema = Schema> {
|
|
|
262
287
|
/**
|
|
263
288
|
* Internal form store interface.
|
|
264
289
|
*/
|
|
265
|
-
interface InternalFormStore<TSchema extends
|
|
290
|
+
interface InternalFormStore<TSchema extends FormSchema = FormSchema> extends InternalObjectStore {
|
|
266
291
|
/**
|
|
267
292
|
* The element of the form.
|
|
268
293
|
*/
|
|
@@ -299,7 +324,7 @@ interface InternalFormStore<TSchema extends Schema = Schema> extends InternalObj
|
|
|
299
324
|
/**
|
|
300
325
|
* Base form store interface.
|
|
301
326
|
*/
|
|
302
|
-
interface BaseFormStore<TSchema extends
|
|
327
|
+
interface BaseFormStore<TSchema extends FormSchema = FormSchema> {
|
|
303
328
|
/**
|
|
304
329
|
* The internal form store.
|
|
305
330
|
*
|
|
@@ -308,7 +333,7 @@ interface BaseFormStore<TSchema extends Schema = Schema> {
|
|
|
308
333
|
readonly [INTERNAL]: InternalFormStore<TSchema>;
|
|
309
334
|
}
|
|
310
335
|
//#endregion
|
|
311
|
-
//#region src/types/path.d.ts
|
|
336
|
+
//#region src/types/path/path.d.ts
|
|
312
337
|
/**
|
|
313
338
|
* Path key type.
|
|
314
339
|
*/
|
|
@@ -322,47 +347,115 @@ type Path = readonly PathKey[];
|
|
|
322
347
|
*/
|
|
323
348
|
type RequiredPath = readonly [PathKey, ...Path];
|
|
324
349
|
/**
|
|
325
|
-
* Extracts the exact keys of a tuple, array or object.
|
|
350
|
+
* Extracts the exact keys of a tuple, array or object. Tuples return their
|
|
351
|
+
* literal numeric indices, dynamic arrays return `number`, objects return
|
|
352
|
+
* their `keyof` keys, and any other input returns `never`.
|
|
326
353
|
*/
|
|
327
|
-
type
|
|
354
|
+
type ExactKeysOf<TValue> = IsAny<TValue> extends true ? never : TValue extends readonly unknown[] ? number extends TValue["length"] ? number : { [TKey in keyof TValue]: TKey extends `${infer TIndex extends number}` ? TIndex : never }[number] : TValue extends Record<PropertyKey, unknown> ? keyof TValue & PathKey : never;
|
|
328
355
|
/**
|
|
329
|
-
*
|
|
356
|
+
* Returns the flat object of all indexable properties of `TValue`. For object
|
|
357
|
+
* unions, properties from every member are merged so that any single property
|
|
358
|
+
* is accessible. For primitives and other non-indexable types, the result is
|
|
359
|
+
* `{}`.
|
|
330
360
|
*
|
|
331
|
-
* Hint: This is necessary to make
|
|
332
|
-
* properties that do not exist in all union options are not
|
|
333
|
-
* and result in "any" when accessed.
|
|
361
|
+
* Hint: This is necessary to make properties accessible across union members.
|
|
362
|
+
* By default, properties that do not exist in all union options are not
|
|
363
|
+
* accessible and result in "any" when accessed.
|
|
334
364
|
*/
|
|
335
|
-
type
|
|
365
|
+
type PropertiesOf<TValue> = { [TKey in ExactKeysOf<TValue>]: TValue extends Record<TKey, infer TItem> ? TItem : never };
|
|
336
366
|
/**
|
|
337
367
|
* Lazily evaluates only the first valid path segment based on the given value.
|
|
338
368
|
*/
|
|
339
|
-
type LazyPath<TValue, TPathToCheck extends Path, TValidPath extends Path = readonly []> = TPathToCheck extends readonly [] ? TValidPath : TPathToCheck extends readonly [infer TFirstKey extends
|
|
369
|
+
type LazyPath<TValue, TPathToCheck extends Path, TValidPath extends Path = readonly []> = TPathToCheck extends readonly [] ? TValidPath : TPathToCheck extends readonly [infer TFirstKey extends ExactKeysOf<TValue>, ...infer TPathRest extends Path] ? LazyPath<Required<PropertiesOf<TValue>[TFirstKey]>, TPathRest, readonly [...TValidPath, TFirstKey]> : IsNever<ExactKeysOf<TValue>> extends false ? readonly [...TValidPath, ExactKeysOf<TValue>] : TValidPath;
|
|
340
370
|
/**
|
|
341
371
|
* Returns the path if valid, otherwise the first possible valid path based on
|
|
342
372
|
* the given value.
|
|
343
373
|
*/
|
|
344
374
|
type ValidPath<TValue, TPath extends RequiredPath> = TPath extends LazyPath<Required<TValue>, TPath> ? TPath : LazyPath<Required<TValue>, TPath>;
|
|
345
375
|
/**
|
|
376
|
+
* Detects whether the consuming project is configured with
|
|
377
|
+
* `exactOptionalPropertyTypes: true`.
|
|
378
|
+
*
|
|
379
|
+
* Hint: If `false` the built-in `Required<T>` strips `| undefined` from
|
|
380
|
+
* optional properties, so `Required<{ key?: undefined }>['key']` collapses
|
|
381
|
+
* to `never` — under strict mode the same expression yields `undefined`.
|
|
382
|
+
*/
|
|
383
|
+
type IsExactOptionalProps = Required<{
|
|
384
|
+
key?: undefined;
|
|
385
|
+
}>["key"] extends never ? false : true;
|
|
386
|
+
/**
|
|
387
|
+
* Like the built-in `Required<T>`, but preserves `| undefined` in two
|
|
388
|
+
* places where `Required<T>` strips it:
|
|
389
|
+
*
|
|
390
|
+
* 1. Optional property values under `exactOptionalPropertyTypes: false`
|
|
391
|
+
* — without this, input typings for `v.optional`/`v.nullish` schemas
|
|
392
|
+
* narrow incorrectly (issue #15).
|
|
393
|
+
* 2. Array/tuple element types — e.g. `(string | undefined)[]` stays
|
|
394
|
+
* `(string | undefined)[]` instead of becoming `string[]`. Arrays
|
|
395
|
+
* fall through unchanged because they only have a numeric index
|
|
396
|
+
* signature and don't structurally extend `Record<PropertyKey,
|
|
397
|
+
* unknown>` (which requires string keys).
|
|
398
|
+
*/
|
|
399
|
+
type ExactRequired<TValue> = TValue extends Record<PropertyKey, unknown> ? IsExactOptionalProps extends true ? Required<TValue> : { [TKey in keyof Required<TValue>]: TValue[TKey] } : TValue;
|
|
400
|
+
/**
|
|
346
401
|
* Extracts the value type at the given path.
|
|
347
402
|
*/
|
|
348
|
-
type PathValue<TValue, TPath extends Path> = TPath extends readonly [infer TKey, ...infer TRest extends Path] ? TKey extends
|
|
403
|
+
type PathValue<TValue, TPath extends Path> = TPath extends readonly [infer TKey, ...infer TRest extends Path] ? TKey extends ExactKeysOf<ExactRequired<TValue>> ? PathValue<PropertiesOf<ExactRequired<TValue>>[TKey], TRest> : unknown : TValue;
|
|
349
404
|
/**
|
|
350
|
-
* Checks
|
|
405
|
+
* Checks whether a value is an array or contains one anywhere in its shape.
|
|
406
|
+
*
|
|
407
|
+
* Hint: The inner conditionals (`TValue extends readonly unknown[]` and
|
|
408
|
+
* `TValue extends Record<PropertyKey, unknown>`) distribute over union members,
|
|
409
|
+
* so the inner expression returns the union of each member's result (e.g.
|
|
410
|
+
* `true | false` when some members contain arrays and others don't).
|
|
411
|
+
* Downstream code uses `IsOrHasArray<T> extends true`, but
|
|
412
|
+
* `boolean extends true` is `false` — so we collapse the result via
|
|
413
|
+
* `true extends ...`, which is `true` whenever at least one union member
|
|
414
|
+
* contributed `true`.
|
|
351
415
|
*/
|
|
352
|
-
type IsOrHasArray<TValue> = IsAny<TValue> extends true ? false : TValue extends readonly unknown[] ? true : TValue extends Record<
|
|
416
|
+
type IsOrHasArray<TValue> = true extends (IsAny<TValue> extends true ? false : TValue extends readonly unknown[] ? true : TValue extends Record<PropertyKey, unknown> ? { [TKey in keyof TValue]: IsOrHasArray<TValue[TKey]> }[keyof TValue] : false) ? true : false;
|
|
353
417
|
/**
|
|
354
418
|
* Extracts the exact keys of a tuple, array or object that contain arrays.
|
|
355
419
|
*/
|
|
356
|
-
type
|
|
420
|
+
type ExactKeysOfArrayPath<TValue> = IsAny<TValue> extends true ? never : TValue extends readonly (infer TItem)[] ? number extends TValue["length"] ? IsOrHasArray<TItem> extends true ? number : never : { [TKey in keyof TValue]: TKey extends `${infer TIndex extends number}` ? IsOrHasArray<NonNullable<TValue[TKey]>> extends true ? TIndex : never : never }[number] : TValue extends Record<PropertyKey, unknown> ? { [TKey in keyof TValue]: IsOrHasArray<NonNullable<TValue[TKey]>> extends true ? TKey : never }[keyof TValue] & PathKey : never;
|
|
421
|
+
/**
|
|
422
|
+
* Returns the flat object of indexable properties of `TValue` whose values
|
|
423
|
+
* are or contain arrays. Mirrors `PropertiesOf` but keyed by
|
|
424
|
+
* `ExactKeysOfArrayPath` so the lookup is provably valid for array-path
|
|
425
|
+
* navigation in `LazyArrayPath`.
|
|
426
|
+
*/
|
|
427
|
+
type PropertiesOfArrayPath<TValue> = { [TKey in ExactKeysOfArrayPath<TValue>]: TValue extends Record<TKey, infer TItem> ? TItem : never };
|
|
357
428
|
/**
|
|
358
429
|
* Lazily evaluates only the first valid array path segment based on the given value.
|
|
359
430
|
*/
|
|
360
|
-
type LazyArrayPath<TValue, TPathToCheck extends Path, TValidPath extends Path = readonly []> = TPathToCheck extends readonly [] ? TValue extends readonly unknown[] ? TValidPath : readonly [...TValidPath,
|
|
431
|
+
type LazyArrayPath<TValue, TPathToCheck extends Path, TValidPath extends Path = readonly []> = TPathToCheck extends readonly [] ? TValue extends readonly unknown[] ? TValidPath : readonly [...TValidPath, ExactKeysOfArrayPath<TValue>] : TPathToCheck extends readonly [infer TFirstKey extends ExactKeysOfArrayPath<TValue>, ...infer TPathRest extends Path] ? LazyArrayPath<Required<PropertiesOfArrayPath<TValue>[TFirstKey]>, TPathRest, readonly [...TValidPath, TFirstKey]> : IsNever<ExactKeysOfArrayPath<TValue>> extends false ? readonly [...TValidPath, ExactKeysOfArrayPath<TValue>] : never;
|
|
361
432
|
/**
|
|
362
433
|
* Returns the path if valid, otherwise the first possible valid array path
|
|
363
434
|
* based on the given value.
|
|
364
435
|
*/
|
|
365
436
|
type ValidArrayPath<TValue, TPath extends RequiredPath> = TPath extends LazyArrayPath<Required<TValue>, TPath> ? TPath : LazyArrayPath<Required<TValue>, TPath>;
|
|
437
|
+
/**
|
|
438
|
+
* Recursive helper for `DirtyPath` that prepends `TKey` to each deeper path,
|
|
439
|
+
* or falls through to `never` when the child is not an object.
|
|
440
|
+
*/
|
|
441
|
+
type DeepDirtyPath<TChild, TKey$1 extends PathKey, TDepth extends 0[]> = TChild extends Record<PropertyKey, unknown> ? readonly [TKey$1, ...DirtyPath<TChild, [...TDepth, 0]>] : never;
|
|
442
|
+
/**
|
|
443
|
+
* Returns the union of all `RequiredPath`s that `getDirtyPaths` can emit
|
|
444
|
+
* for a given input type. Object fields contribute their own path and the
|
|
445
|
+
* paths of their descendants; arrays and tuples are atomic and contribute
|
|
446
|
+
* only their own path, because dirty arrays are returned as complete units.
|
|
447
|
+
*
|
|
448
|
+
* Narrowing is exact for the first 5 levels of nesting; deeper paths fall
|
|
449
|
+
* back to `RequiredPath` to keep the result a complete superset of any
|
|
450
|
+
* path the runtime can address.
|
|
451
|
+
*
|
|
452
|
+
* Hint: Arrays and tuples are atomic because they don't structurally
|
|
453
|
+
* extend `Record<PropertyKey, unknown>` and so fall through to `never`
|
|
454
|
+
* via `DeepDirtyPath` — no explicit array check is needed. `TDepth` is
|
|
455
|
+
* a tuple-length counter capped at 5 to bound TypeScript instantiation
|
|
456
|
+
* cost.
|
|
457
|
+
*/
|
|
458
|
+
type DirtyPath<TValue, TDepth extends 0[] = []> = TDepth["length"] extends 5 ? RequiredPath : TValue extends Record<PropertyKey, unknown> ? { [TKey in ExactKeysOf<TValue>]: readonly [TKey] | DeepDirtyPath<NonNullable<PropertiesOf<TValue>[TKey]>, TKey, TDepth> }[ExactKeysOf<TValue>] : never;
|
|
366
459
|
//#endregion
|
|
367
460
|
//#region src/array/copyItemState/copyItemState.d.ts
|
|
368
461
|
/**
|
|
@@ -381,7 +474,7 @@ type ValidArrayPath<TValue, TPath extends RequiredPath> = TPath extends LazyArra
|
|
|
381
474
|
/**
|
|
382
475
|
* Focus field config interface.
|
|
383
476
|
*/
|
|
384
|
-
interface FocusFieldConfig<TSchema extends
|
|
477
|
+
interface FocusFieldConfig<TSchema extends FormSchema, TFieldPath extends RequiredPath> {
|
|
385
478
|
/**
|
|
386
479
|
* The path to the field to focus.
|
|
387
480
|
*/
|
|
@@ -395,7 +488,7 @@ interface FocusFieldConfig<TSchema extends Schema, TFieldPath extends RequiredPa
|
|
|
395
488
|
* @param form The form store containing the field.
|
|
396
489
|
* @param config The focus field configuration.
|
|
397
490
|
*/
|
|
398
|
-
declare function focus<TSchema extends
|
|
491
|
+
declare function focus<TSchema extends FormSchema, TFieldPath extends RequiredPath>(form: BaseFormStore<TSchema>, config: FocusFieldConfig<TSchema, TFieldPath>): void;
|
|
399
492
|
//#endregion
|
|
400
493
|
//#region src/getAllErrors/getAllErrors.d.ts
|
|
401
494
|
/**
|
|
@@ -409,6 +502,93 @@ declare function focus<TSchema extends Schema, TFieldPath extends RequiredPath>(
|
|
|
409
502
|
*/
|
|
410
503
|
declare function getAllErrors(form: BaseFormStore): [string, ...string[]] | null;
|
|
411
504
|
//#endregion
|
|
505
|
+
//#region src/getDirtyInput/getDirtyInput.d.ts
|
|
506
|
+
/**
|
|
507
|
+
* Get form dirty input config interface.
|
|
508
|
+
*/
|
|
509
|
+
interface GetFormDirtyInputConfig {
|
|
510
|
+
/**
|
|
511
|
+
* The path to a field. Leave undefined to get the dirty input of the entire
|
|
512
|
+
* form.
|
|
513
|
+
*/
|
|
514
|
+
readonly path?: undefined;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Get field dirty input config interface.
|
|
518
|
+
*/
|
|
519
|
+
interface GetFieldDirtyInputConfig<TSchema extends FormSchema, TFieldPath extends RequiredPath> {
|
|
520
|
+
/**
|
|
521
|
+
* The path to the field to retrieve the dirty input from.
|
|
522
|
+
*/
|
|
523
|
+
readonly path: ValidPath<v.InferInput<TSchema>, TFieldPath>;
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Retrieves only the dirty input values of a specific field or the entire
|
|
527
|
+
* form. Arrays are treated as atomic and returned in full if any item is
|
|
528
|
+
* dirty, while object keys without a dirty descendant are omitted. Returns
|
|
529
|
+
* `undefined` if no field in the inspected subtree is dirty.
|
|
530
|
+
*
|
|
531
|
+
* @param form The form store to retrieve dirty input from.
|
|
532
|
+
*
|
|
533
|
+
* @returns The dirty input of the form or specified field, or `undefined`.
|
|
534
|
+
*/
|
|
535
|
+
declare function getDirtyInput<TSchema extends FormSchema>(form: BaseFormStore<TSchema>): DeepPartial<v.InferInput<TSchema>> | undefined;
|
|
536
|
+
/**
|
|
537
|
+
* Retrieves only the dirty input values of a specific field or the entire
|
|
538
|
+
* form. Arrays are treated as atomic and returned in full if any item is
|
|
539
|
+
* dirty, while object keys without a dirty descendant are omitted. Returns
|
|
540
|
+
* `undefined` if no field in the inspected subtree is dirty.
|
|
541
|
+
*
|
|
542
|
+
* @param form The form store to retrieve dirty input from.
|
|
543
|
+
* @param config The get dirty input configuration.
|
|
544
|
+
*
|
|
545
|
+
* @returns The dirty input of the form or specified field, or `undefined`.
|
|
546
|
+
*/
|
|
547
|
+
declare function getDirtyInput<TSchema extends FormSchema, TFieldPath extends RequiredPath | undefined = undefined>(form: BaseFormStore<TSchema>, config: TFieldPath extends RequiredPath ? GetFieldDirtyInputConfig<TSchema, TFieldPath> : GetFormDirtyInputConfig): DeepPartial<TFieldPath extends RequiredPath ? PathValue<v.InferInput<TSchema>, TFieldPath> : v.InferInput<TSchema>> | undefined;
|
|
548
|
+
//#endregion
|
|
549
|
+
//#region src/getDirtyPaths/getDirtyPaths.d.ts
|
|
550
|
+
/**
|
|
551
|
+
* Get form dirty paths config interface.
|
|
552
|
+
*/
|
|
553
|
+
interface GetFormDirtyPathsConfig {
|
|
554
|
+
/**
|
|
555
|
+
* The path to a field. Leave undefined to inspect the entire form.
|
|
556
|
+
*/
|
|
557
|
+
readonly path?: undefined;
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* Get field dirty paths config interface.
|
|
561
|
+
*/
|
|
562
|
+
interface GetFieldDirtyPathsConfig<TSchema extends FormSchema, TFieldPath extends RequiredPath> {
|
|
563
|
+
/**
|
|
564
|
+
* The path to the field to inspect.
|
|
565
|
+
*/
|
|
566
|
+
readonly path: ValidPath<v.InferInput<TSchema>, TFieldPath>;
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* Returns a list of paths to the dirty fields of a specific field or the
|
|
570
|
+
* entire form. Arrays are treated as atomic and contribute only their own
|
|
571
|
+
* path if any item is dirty, while object branches are recursed into. Returns
|
|
572
|
+
* an empty list if no field in the inspected subtree is dirty.
|
|
573
|
+
*
|
|
574
|
+
* @param form The form store to inspect.
|
|
575
|
+
*
|
|
576
|
+
* @returns The list of paths to the dirty fields.
|
|
577
|
+
*/
|
|
578
|
+
declare function getDirtyPaths<TSchema extends FormSchema>(form: BaseFormStore<TSchema>): DirtyPath<v.InferInput<TSchema>>[];
|
|
579
|
+
/**
|
|
580
|
+
* Returns a list of paths to the dirty fields of a specific field or the
|
|
581
|
+
* entire form. Arrays are treated as atomic and contribute only their own
|
|
582
|
+
* path if any item is dirty, while object branches are recursed into. Returns
|
|
583
|
+
* an empty list if no field in the inspected subtree is dirty.
|
|
584
|
+
*
|
|
585
|
+
* @param form The form store to inspect.
|
|
586
|
+
* @param config The get dirty paths configuration.
|
|
587
|
+
*
|
|
588
|
+
* @returns The list of paths to the dirty fields.
|
|
589
|
+
*/
|
|
590
|
+
declare function getDirtyPaths<TSchema extends FormSchema, TFieldPath extends RequiredPath | undefined = undefined>(form: BaseFormStore<TSchema>, config: TFieldPath extends RequiredPath ? GetFieldDirtyPathsConfig<TSchema, TFieldPath> : GetFormDirtyPathsConfig): DirtyPath<v.InferInput<TSchema>>[];
|
|
591
|
+
//#endregion
|
|
412
592
|
//#region src/getErrors/getErrors.d.ts
|
|
413
593
|
/**
|
|
414
594
|
* Get form errors config interface.
|
|
@@ -422,7 +602,7 @@ interface GetFormErrorsConfig {
|
|
|
422
602
|
/**
|
|
423
603
|
* Get field errors config interface.
|
|
424
604
|
*/
|
|
425
|
-
interface GetFieldErrorsConfig<TSchema extends
|
|
605
|
+
interface GetFieldErrorsConfig<TSchema extends FormSchema, TFieldPath extends RequiredPath> {
|
|
426
606
|
/**
|
|
427
607
|
* The path to the field to retrieve errors from.
|
|
428
608
|
*/
|
|
@@ -437,7 +617,7 @@ interface GetFieldErrorsConfig<TSchema extends Schema, TFieldPath extends Requir
|
|
|
437
617
|
*
|
|
438
618
|
* @returns A non-empty array of error messages, or null if no errors exist.
|
|
439
619
|
*/
|
|
440
|
-
declare function getErrors<TSchema extends
|
|
620
|
+
declare function getErrors<TSchema extends FormSchema>(form: BaseFormStore<TSchema>): [string, ...string[]] | null;
|
|
441
621
|
/**
|
|
442
622
|
* Retrieves error messages from the form. When called without a config,
|
|
443
623
|
* returns form-level errors. When called with a path, returns errors for
|
|
@@ -448,7 +628,7 @@ declare function getErrors<TSchema extends Schema>(form: BaseFormStore<TSchema>)
|
|
|
448
628
|
*
|
|
449
629
|
* @returns A non-empty array of error messages, or null if no errors exist.
|
|
450
630
|
*/
|
|
451
|
-
declare function getErrors<TSchema extends
|
|
631
|
+
declare function getErrors<TSchema extends FormSchema, TFieldPath extends RequiredPath | undefined = undefined>(form: BaseFormStore<TSchema>, config: TFieldPath extends RequiredPath ? GetFieldErrorsConfig<TSchema, TFieldPath> : GetFormErrorsConfig): [string, ...string[]] | null;
|
|
452
632
|
//#endregion
|
|
453
633
|
//#region src/getInput/getInput.d.ts
|
|
454
634
|
/**
|
|
@@ -463,7 +643,7 @@ interface GetFormInputConfig {
|
|
|
463
643
|
/**
|
|
464
644
|
* Get field input config interface.
|
|
465
645
|
*/
|
|
466
|
-
interface GetFieldInputConfig<TSchema extends
|
|
646
|
+
interface GetFieldInputConfig<TSchema extends FormSchema, TFieldPath extends RequiredPath> {
|
|
467
647
|
/**
|
|
468
648
|
* The path to the field to retrieve input from.
|
|
469
649
|
*/
|
|
@@ -477,7 +657,7 @@ interface GetFieldInputConfig<TSchema extends Schema, TFieldPath extends Require
|
|
|
477
657
|
*
|
|
478
658
|
* @returns The partial input values of the form or the specified field.
|
|
479
659
|
*/
|
|
480
|
-
declare function getInput<TSchema extends
|
|
660
|
+
declare function getInput<TSchema extends FormSchema>(form: BaseFormStore<TSchema>): PartialValues<v.InferInput<TSchema>>;
|
|
481
661
|
/**
|
|
482
662
|
* Retrieves the current input value of a specific field or the entire form.
|
|
483
663
|
* Returns a partial object as not all fields may have been set.
|
|
@@ -487,7 +667,7 @@ declare function getInput<TSchema extends Schema>(form: BaseFormStore<TSchema>):
|
|
|
487
667
|
*
|
|
488
668
|
* @returns The partial input values of the form or the specified field.
|
|
489
669
|
*/
|
|
490
|
-
declare function getInput<TSchema extends
|
|
670
|
+
declare function getInput<TSchema extends FormSchema, TFieldPath extends RequiredPath | undefined = undefined>(form: BaseFormStore<TSchema>, config: TFieldPath extends RequiredPath ? GetFieldInputConfig<TSchema, TFieldPath> : GetFormInputConfig): PartialValues<TFieldPath extends RequiredPath ? PathValue<v.InferInput<TSchema>, TFieldPath> : v.InferInput<TSchema>>;
|
|
491
671
|
//#endregion
|
|
492
672
|
//#region src/handleSubmit/handleSubmit.d.ts
|
|
493
673
|
/**
|
|
@@ -500,7 +680,7 @@ declare function getInput<TSchema extends Schema, TFieldPath extends RequiredPat
|
|
|
500
680
|
*
|
|
501
681
|
* @returns A submit event handler function to attach to the form element.
|
|
502
682
|
*/
|
|
503
|
-
declare function handleSubmit<TSchema extends
|
|
683
|
+
declare function handleSubmit<TSchema extends FormSchema>(form: BaseFormStore<TSchema>, handler: SubmitHandler<TSchema>): () => Promise<void>;
|
|
504
684
|
/**
|
|
505
685
|
* Creates a submit event handler for the form that prevents default browser
|
|
506
686
|
* submission, validates the form input, and calls the provided handler if
|
|
@@ -511,13 +691,13 @@ declare function handleSubmit<TSchema extends Schema>(form: BaseFormStore<TSchem
|
|
|
511
691
|
*
|
|
512
692
|
* @returns A submit event handler function to attach to the form element.
|
|
513
693
|
*/
|
|
514
|
-
declare function handleSubmit<TSchema extends
|
|
694
|
+
declare function handleSubmit<TSchema extends FormSchema>(form: BaseFormStore<TSchema>, handler: SubmitEventHandler<TSchema>): (event: SubmitEvent) => Promise<void>;
|
|
515
695
|
//#endregion
|
|
516
696
|
//#region src/insert/insert.d.ts
|
|
517
697
|
/**
|
|
518
698
|
* Insert array field config interface.
|
|
519
699
|
*/
|
|
520
|
-
interface InsertConfig<TSchema extends
|
|
700
|
+
interface InsertConfig<TSchema extends FormSchema, TFieldArrayPath extends RequiredPath> {
|
|
521
701
|
/**
|
|
522
702
|
* The path to the field array to insert into.
|
|
523
703
|
*/
|
|
@@ -538,13 +718,13 @@ interface InsertConfig<TSchema extends Schema, TFieldArrayPath extends RequiredP
|
|
|
538
718
|
* @param form The form store containing the field array.
|
|
539
719
|
* @param config The insert configuration specifying the path, index, and initial value.
|
|
540
720
|
*/
|
|
541
|
-
declare function insert<TSchema extends
|
|
721
|
+
declare function insert<TSchema extends FormSchema, TFieldArrayPath extends RequiredPath>(form: BaseFormStore<TSchema>, config: InsertConfig<TSchema, TFieldArrayPath>): void;
|
|
542
722
|
//#endregion
|
|
543
723
|
//#region src/move/move.d.ts
|
|
544
724
|
/**
|
|
545
725
|
* Move array field config interface.
|
|
546
726
|
*/
|
|
547
|
-
interface MoveConfig<TSchema extends
|
|
727
|
+
interface MoveConfig<TSchema extends FormSchema, TFieldArrayPath extends RequiredPath> {
|
|
548
728
|
/**
|
|
549
729
|
* The path to the field array to move an item within.
|
|
550
730
|
*/
|
|
@@ -565,13 +745,38 @@ interface MoveConfig<TSchema extends Schema, TFieldArrayPath extends RequiredPat
|
|
|
565
745
|
* @param form The form store containing the field array.
|
|
566
746
|
* @param config The move configuration specifying the path and source/destination indices.
|
|
567
747
|
*/
|
|
568
|
-
declare function move<TSchema extends
|
|
748
|
+
declare function move<TSchema extends FormSchema, TFieldArrayPath extends RequiredPath>(form: BaseFormStore<TSchema>, config: MoveConfig<TSchema, TFieldArrayPath>): void;
|
|
749
|
+
//#endregion
|
|
750
|
+
//#region src/pickDirty/pickDirty.d.ts
|
|
751
|
+
/**
|
|
752
|
+
* Pick dirty config interface.
|
|
753
|
+
*/
|
|
754
|
+
interface PickDirtyConfig<TValue extends object> {
|
|
755
|
+
/**
|
|
756
|
+
* The value to filter down to its dirty parts. Must be structurally
|
|
757
|
+
* compatible with the form's schema.
|
|
758
|
+
*/
|
|
759
|
+
readonly from: TValue;
|
|
760
|
+
}
|
|
761
|
+
/**
|
|
762
|
+
* Picks only the dirty parts of the given value, using the form's dirty fields
|
|
763
|
+
* as a structural mask. Arrays are treated as atomic and object keys without a
|
|
764
|
+
* dirty descendant are omitted. Returns `undefined` if no field is dirty.
|
|
765
|
+
* Useful for filtering a validated output down to its changed parts before
|
|
766
|
+
* submitting.
|
|
767
|
+
*
|
|
768
|
+
* @param form The form store providing the dirty mask.
|
|
769
|
+
* @param config The pick dirty configuration.
|
|
770
|
+
*
|
|
771
|
+
* @returns The dirty parts of the value, or `undefined`.
|
|
772
|
+
*/
|
|
773
|
+
declare function pickDirty<TSchema extends FormSchema, TValue extends object>(form: BaseFormStore<TSchema>, config: PickDirtyConfig<TValue>): DeepPartial<TValue> | undefined;
|
|
569
774
|
//#endregion
|
|
570
775
|
//#region src/remove/remove.d.ts
|
|
571
776
|
/**
|
|
572
777
|
* Remove array field config interface.
|
|
573
778
|
*/
|
|
574
|
-
interface RemoveConfig<TSchema extends
|
|
779
|
+
interface RemoveConfig<TSchema extends FormSchema, TFieldArrayPath extends RequiredPath> {
|
|
575
780
|
/**
|
|
576
781
|
* The path to the field array to remove an item from.
|
|
577
782
|
*/
|
|
@@ -588,13 +793,13 @@ interface RemoveConfig<TSchema extends Schema, TFieldArrayPath extends RequiredP
|
|
|
588
793
|
* @param form The form store containing the field array.
|
|
589
794
|
* @param config The remove configuration specifying the path and index.
|
|
590
795
|
*/
|
|
591
|
-
declare function remove<TSchema extends
|
|
796
|
+
declare function remove<TSchema extends FormSchema, TFieldArrayPath extends RequiredPath>(form: BaseFormStore<TSchema>, config: RemoveConfig<TSchema, TFieldArrayPath>): void;
|
|
592
797
|
//#endregion
|
|
593
798
|
//#region src/replace/replace.d.ts
|
|
594
799
|
/**
|
|
595
800
|
* Replace array field config interface.
|
|
596
801
|
*/
|
|
597
|
-
interface ReplaceConfig<TSchema extends
|
|
802
|
+
interface ReplaceConfig<TSchema extends FormSchema, TFieldArrayPath extends RequiredPath> {
|
|
598
803
|
/**
|
|
599
804
|
* The path to the field array to replace an item within.
|
|
600
805
|
*/
|
|
@@ -614,7 +819,7 @@ interface ReplaceConfig<TSchema extends Schema, TFieldArrayPath extends Required
|
|
|
614
819
|
* @param form The form store containing the field array.
|
|
615
820
|
* @param config The replace configuration specifying the path, index, and initial input.
|
|
616
821
|
*/
|
|
617
|
-
declare function replace<TSchema extends
|
|
822
|
+
declare function replace<TSchema extends FormSchema, TFieldArrayPath extends RequiredPath>(form: BaseFormStore<TSchema>, config: ReplaceConfig<TSchema, TFieldArrayPath>): void;
|
|
618
823
|
//#endregion
|
|
619
824
|
//#region src/reset/reset.d.ts
|
|
620
825
|
/**
|
|
@@ -637,7 +842,7 @@ interface ResetBaseConfig {
|
|
|
637
842
|
/**
|
|
638
843
|
* Reset form config interface.
|
|
639
844
|
*/
|
|
640
|
-
interface ResetFormConfig<TSchema extends
|
|
845
|
+
interface ResetFormConfig<TSchema extends FormSchema> extends ResetBaseConfig {
|
|
641
846
|
/**
|
|
642
847
|
* The path to a field. Leave undefined to reset the entire form.
|
|
643
848
|
*/
|
|
@@ -655,7 +860,7 @@ interface ResetFormConfig<TSchema extends Schema> extends ResetBaseConfig {
|
|
|
655
860
|
/**
|
|
656
861
|
* Reset field config interface.
|
|
657
862
|
*/
|
|
658
|
-
interface ResetFieldConfig<TSchema extends
|
|
863
|
+
interface ResetFieldConfig<TSchema extends FormSchema, TFieldPath extends RequiredPath> extends ResetBaseConfig {
|
|
659
864
|
/**
|
|
660
865
|
* The path to the field to reset.
|
|
661
866
|
*/
|
|
@@ -682,7 +887,7 @@ declare function reset(form: BaseFormStore): void;
|
|
|
682
887
|
* @param form The form store to reset.
|
|
683
888
|
* @param config The reset configuration specifying what to reset and what to keep.
|
|
684
889
|
*/
|
|
685
|
-
declare function reset<TSchema extends
|
|
890
|
+
declare function reset<TSchema extends FormSchema, TFieldPath extends RequiredPath | undefined = undefined>(form: BaseFormStore<TSchema>, config: TFieldPath extends RequiredPath ? ResetFieldConfig<TSchema, TFieldPath> : ResetFormConfig<TSchema>): void;
|
|
686
891
|
//#endregion
|
|
687
892
|
//#region src/setErrors/setErrors.d.ts
|
|
688
893
|
/**
|
|
@@ -701,7 +906,7 @@ interface SetFormErrorsConfig {
|
|
|
701
906
|
/**
|
|
702
907
|
* Set field errors config interface.
|
|
703
908
|
*/
|
|
704
|
-
interface SetFieldErrorsConfig<TSchema extends
|
|
909
|
+
interface SetFieldErrorsConfig<TSchema extends FormSchema, TFieldPath extends RequiredPath> {
|
|
705
910
|
/**
|
|
706
911
|
* The path to the field to set errors on.
|
|
707
912
|
*/
|
|
@@ -719,13 +924,13 @@ interface SetFieldErrorsConfig<TSchema extends Schema, TFieldPath extends Requir
|
|
|
719
924
|
* @param form The form store to set errors on.
|
|
720
925
|
* @param config The set errors configuration specifying the path and error messages.
|
|
721
926
|
*/
|
|
722
|
-
declare function setErrors<TSchema extends
|
|
927
|
+
declare function setErrors<TSchema extends FormSchema, TFieldPath extends RequiredPath | undefined = undefined>(form: BaseFormStore<TSchema>, config: TFieldPath extends RequiredPath ? SetFieldErrorsConfig<TSchema, TFieldPath> : SetFormErrorsConfig): void;
|
|
723
928
|
//#endregion
|
|
724
929
|
//#region src/setInput/setInput.d.ts
|
|
725
930
|
/**
|
|
726
931
|
* Set form input config interface.
|
|
727
932
|
*/
|
|
728
|
-
interface SetFormInputConfig<TSchema extends
|
|
933
|
+
interface SetFormInputConfig<TSchema extends FormSchema> {
|
|
729
934
|
/**
|
|
730
935
|
* The path to a field. Leave undefined to set the entire form input.
|
|
731
936
|
*/
|
|
@@ -738,7 +943,7 @@ interface SetFormInputConfig<TSchema extends Schema> {
|
|
|
738
943
|
/**
|
|
739
944
|
* Set field input config interface.
|
|
740
945
|
*/
|
|
741
|
-
interface SetFieldInputConfig<TSchema extends
|
|
946
|
+
interface SetFieldInputConfig<TSchema extends FormSchema, TFieldPath extends RequiredPath> {
|
|
742
947
|
/**
|
|
743
948
|
* The path to the field to set input on.
|
|
744
949
|
*/
|
|
@@ -756,7 +961,7 @@ interface SetFieldInputConfig<TSchema extends Schema, TFieldPath extends Require
|
|
|
756
961
|
* @param form The form store to set input on.
|
|
757
962
|
* @param config The set form input configuration specifying the new input values.
|
|
758
963
|
*/
|
|
759
|
-
declare function setInput<TSchema extends
|
|
964
|
+
declare function setInput<TSchema extends FormSchema>(form: BaseFormStore<TSchema>, config: SetFormInputConfig<TSchema>): void;
|
|
760
965
|
/**
|
|
761
966
|
* Sets the input value of a specific field or the entire form. This updates
|
|
762
967
|
* the field value(s) and triggers validation if required by the form's
|
|
@@ -765,7 +970,7 @@ declare function setInput<TSchema extends Schema>(form: BaseFormStore<TSchema>,
|
|
|
765
970
|
* @param form The form store to set input on.
|
|
766
971
|
* @param config The set input configuration specifying the path and new value.
|
|
767
972
|
*/
|
|
768
|
-
declare function setInput<TSchema extends
|
|
973
|
+
declare function setInput<TSchema extends FormSchema, TFieldPath extends RequiredPath | undefined = undefined>(form: BaseFormStore<TSchema>, config: TFieldPath extends RequiredPath ? SetFieldInputConfig<TSchema, TFieldPath> : SetFormInputConfig<TSchema>): void;
|
|
769
974
|
//#endregion
|
|
770
975
|
//#region src/submit/submit.d.ts
|
|
771
976
|
/**
|
|
@@ -780,7 +985,7 @@ declare function submit(form: BaseFormStore): void;
|
|
|
780
985
|
/**
|
|
781
986
|
* Swap array field config interface.
|
|
782
987
|
*/
|
|
783
|
-
interface SwapConfig<TSchema extends
|
|
988
|
+
interface SwapConfig<TSchema extends FormSchema, TFieldArrayPath extends RequiredPath> {
|
|
784
989
|
/**
|
|
785
990
|
* The path to the field array to swap items within.
|
|
786
991
|
*/
|
|
@@ -800,7 +1005,7 @@ interface SwapConfig<TSchema extends Schema, TFieldArrayPath extends RequiredPat
|
|
|
800
1005
|
* @param form The form store containing the field array.
|
|
801
1006
|
* @param config The swap configuration specifying the path and indices to swap.
|
|
802
1007
|
*/
|
|
803
|
-
declare function swap<TSchema extends
|
|
1008
|
+
declare function swap<TSchema extends FormSchema, TFieldArrayPath extends RequiredPath>(form: BaseFormStore<TSchema>, config: SwapConfig<TSchema, TFieldArrayPath>): void;
|
|
804
1009
|
//#endregion
|
|
805
1010
|
//#region src/validate/validate.d.ts
|
|
806
1011
|
/**
|
|
@@ -822,7 +1027,7 @@ interface ValidateFormConfig {
|
|
|
822
1027
|
*
|
|
823
1028
|
* @returns A promise resolving to the validation result.
|
|
824
1029
|
*/
|
|
825
|
-
declare function validate<TSchema extends
|
|
1030
|
+
declare function validate<TSchema extends FormSchema>(form: BaseFormStore<TSchema>, config?: ValidateFormConfig): Promise<v.SafeParseResult<TSchema>>;
|
|
826
1031
|
//#endregion
|
|
827
1032
|
//#endregion
|
|
828
1033
|
//#region src/types/field.d.ts
|
|
@@ -862,7 +1067,7 @@ interface FieldElementProps {
|
|
|
862
1067
|
/**
|
|
863
1068
|
* Field store interface.
|
|
864
1069
|
*/
|
|
865
|
-
interface FieldStore<TSchema extends
|
|
1070
|
+
interface FieldStore<TSchema extends FormSchema = FormSchema, TFieldPath extends RequiredPath = RequiredPath> {
|
|
866
1071
|
/**
|
|
867
1072
|
* The path to the field within the form.
|
|
868
1073
|
*/
|
|
@@ -899,7 +1104,7 @@ interface FieldStore<TSchema extends Schema = Schema, TFieldPath extends Require
|
|
|
899
1104
|
/**
|
|
900
1105
|
* Field array store interface.
|
|
901
1106
|
*/
|
|
902
|
-
interface FieldArrayStore<TSchema extends
|
|
1107
|
+
interface FieldArrayStore<TSchema extends FormSchema = FormSchema, TFieldArrayPath extends RequiredPath = RequiredPath> {
|
|
903
1108
|
/**
|
|
904
1109
|
* The path to the array field within the form.
|
|
905
1110
|
*/
|
|
@@ -930,7 +1135,7 @@ interface FieldArrayStore<TSchema extends Schema = Schema, TFieldArrayPath exten
|
|
|
930
1135
|
/**
|
|
931
1136
|
* Form store interface.
|
|
932
1137
|
*/
|
|
933
|
-
interface FormStore<TSchema extends
|
|
1138
|
+
interface FormStore<TSchema extends FormSchema = FormSchema> extends BaseFormStore<TSchema> {
|
|
934
1139
|
/**
|
|
935
1140
|
* Whether the form is currently submitting.
|
|
936
1141
|
*/
|
|
@@ -968,7 +1173,7 @@ interface FormStore<TSchema extends Schema = Schema> extends BaseFormStore<TSche
|
|
|
968
1173
|
/**
|
|
969
1174
|
* Field component props interface.
|
|
970
1175
|
*/
|
|
971
|
-
interface FieldProps<TSchema extends
|
|
1176
|
+
interface FieldProps<TSchema extends FormSchema = FormSchema, TFieldPath extends RequiredPath = RequiredPath> {
|
|
972
1177
|
/**
|
|
973
1178
|
* The form store to which the field belongs.
|
|
974
1179
|
*/
|
|
@@ -989,13 +1194,13 @@ interface FieldProps<TSchema extends Schema = Schema, TFieldPath extends Require
|
|
|
989
1194
|
*
|
|
990
1195
|
* @returns The UI of the field to be rendered.
|
|
991
1196
|
*/
|
|
992
|
-
declare const Field: <TSchema extends
|
|
1197
|
+
declare const Field: <TSchema extends FormSchema, TFieldPath extends RequiredPath>(props: _qwik_dev_core_internal0.PublicProps<FieldProps<TSchema, TFieldPath>>, key: string | null, flags: number, dev?: _qwik_dev_core_internal0.DevJSX) => JSXOutput;
|
|
993
1198
|
//#endregion
|
|
994
1199
|
//#region src/components/FieldArray/FieldArray.d.ts
|
|
995
1200
|
/**
|
|
996
1201
|
* FieldArray component props interface.
|
|
997
1202
|
*/
|
|
998
|
-
interface FieldArrayProps<TSchema extends
|
|
1203
|
+
interface FieldArrayProps<TSchema extends FormSchema = FormSchema, TFieldArrayPath extends RequiredPath = RequiredPath> {
|
|
999
1204
|
/**
|
|
1000
1205
|
* The form store to which the field array belongs.
|
|
1001
1206
|
*/
|
|
@@ -1017,13 +1222,13 @@ interface FieldArrayProps<TSchema extends Schema = Schema, TFieldArrayPath exten
|
|
|
1017
1222
|
*
|
|
1018
1223
|
* @returns The UI of the field array to be rendered.
|
|
1019
1224
|
*/
|
|
1020
|
-
declare const FieldArray: <TSchema extends
|
|
1225
|
+
declare const FieldArray: <TSchema extends FormSchema, TFieldArrayPath extends RequiredPath>(props: _qwik_dev_core_internal0.PublicProps<FieldArrayProps<TSchema, TFieldArrayPath>>, key: string | null, flags: number, dev?: _qwik_dev_core_internal0.DevJSX) => JSXOutput;
|
|
1021
1226
|
//#endregion
|
|
1022
1227
|
//#region src/components/Form/Form.d.ts
|
|
1023
1228
|
/**
|
|
1024
1229
|
* Form component props type.
|
|
1025
1230
|
*/
|
|
1026
|
-
type FormProps<TSchema extends
|
|
1231
|
+
type FormProps<TSchema extends FormSchema = FormSchema> = Omit<PropsOf<'form'>, 'onSubmit$' | 'noValidate'> & {
|
|
1027
1232
|
/**
|
|
1028
1233
|
* The form store instance.
|
|
1029
1234
|
*/
|
|
@@ -1039,13 +1244,13 @@ type FormProps<TSchema extends Schema = Schema> = Omit<PropsOf<'form'>, 'onSubmi
|
|
|
1039
1244
|
*
|
|
1040
1245
|
* @returns The a native form element.
|
|
1041
1246
|
*/
|
|
1042
|
-
declare const Form: <TSchema extends
|
|
1247
|
+
declare const Form: <TSchema extends FormSchema>(props: _qwik_dev_core_internal0.PublicProps<FormProps<TSchema>>, key: string | null, flags: number, dev?: _qwik_dev_core_internal0.DevJSX) => JSXOutput;
|
|
1043
1248
|
//#endregion
|
|
1044
1249
|
//#region src/hooks/useField/useField.d.ts
|
|
1045
1250
|
/**
|
|
1046
1251
|
* Use field config interface.
|
|
1047
1252
|
*/
|
|
1048
|
-
interface UseFieldConfig<TSchema extends
|
|
1253
|
+
interface UseFieldConfig<TSchema extends FormSchema = FormSchema, TFieldPath extends RequiredPath = RequiredPath> {
|
|
1049
1254
|
/**
|
|
1050
1255
|
* The path to the field within the form schema.
|
|
1051
1256
|
*/
|
|
@@ -1059,13 +1264,13 @@ interface UseFieldConfig<TSchema extends Schema = Schema, TFieldPath extends Req
|
|
|
1059
1264
|
*
|
|
1060
1265
|
* @returns The field store with reactive properties and element props.
|
|
1061
1266
|
*/
|
|
1062
|
-
declare function useField<TSchema extends
|
|
1267
|
+
declare function useField<TSchema extends FormSchema, TFieldPath extends RequiredPath>(form: FormStore<TSchema>, config: UseFieldConfig<TSchema, TFieldPath>): FieldStore<TSchema, TFieldPath>;
|
|
1063
1268
|
//#endregion
|
|
1064
1269
|
//#region src/hooks/useFieldArray/useFieldArray.d.ts
|
|
1065
1270
|
/**
|
|
1066
1271
|
* Use field array config interface.
|
|
1067
1272
|
*/
|
|
1068
|
-
interface UseFieldArrayConfig<TSchema extends
|
|
1273
|
+
interface UseFieldArrayConfig<TSchema extends FormSchema = FormSchema, TFieldArrayPath extends RequiredPath = RequiredPath> {
|
|
1069
1274
|
/**
|
|
1070
1275
|
* The path to the field array within the form schema.
|
|
1071
1276
|
*/
|
|
@@ -1079,7 +1284,7 @@ interface UseFieldArrayConfig<TSchema extends Schema = Schema, TFieldArrayPath e
|
|
|
1079
1284
|
*
|
|
1080
1285
|
* @returns The field array store with reactive properties for array management.
|
|
1081
1286
|
*/
|
|
1082
|
-
declare function useFieldArray<TSchema extends
|
|
1287
|
+
declare function useFieldArray<TSchema extends FormSchema, TFieldArrayPath extends RequiredPath>(form: FormStore<TSchema>, config: UseFieldArrayConfig<TSchema, TFieldArrayPath>): FieldArrayStore<TSchema, TFieldArrayPath>;
|
|
1083
1288
|
//#endregion
|
|
1084
1289
|
//#region src/hooks/useForm$/useForm$.d.ts
|
|
1085
1290
|
/**
|
|
@@ -1090,7 +1295,7 @@ declare function useFieldArray<TSchema extends Schema, TFieldArrayPath extends R
|
|
|
1090
1295
|
*
|
|
1091
1296
|
* @returns The form store with reactive properties.
|
|
1092
1297
|
*/
|
|
1093
|
-
declare function useFormQrl<TSchema extends
|
|
1298
|
+
declare function useFormQrl<TSchema extends FormSchema>(configQrl: QRL<() => FormConfig<TSchema>>): FormStore<TSchema>;
|
|
1094
1299
|
/**
|
|
1095
1300
|
* Creates a reactive form store from a form configuration. The form store
|
|
1096
1301
|
* manages form state and provides reactive properties.
|
|
@@ -1099,6 +1304,6 @@ declare function useFormQrl<TSchema extends Schema>(configQrl: QRL<() => FormCon
|
|
|
1099
1304
|
*
|
|
1100
1305
|
* @returns The form store with reactive properties.
|
|
1101
1306
|
*/
|
|
1102
|
-
declare const useForm$: <TSchema extends
|
|
1307
|
+
declare const useForm$: <TSchema extends FormSchema>(qrl: () => FormConfig<TSchema>) => FormStore<TSchema>;
|
|
1103
1308
|
//#endregion
|
|
1104
|
-
export { type DeepPartial, Field, FieldArray, FieldArrayProps, FieldArrayStore, type FieldElement, FieldElementProps, FieldProps, FieldStore, FocusFieldConfig, Form, type FormConfig, FormProps, FormStore, GetFieldErrorsConfig, GetFieldInputConfig, GetFormErrorsConfig, GetFormInputConfig, InsertConfig, MoveConfig, type PartialValues, type PathValue, RemoveConfig, ReplaceConfig, type RequiredPath, ResetFieldConfig, ResetFormConfig, type Schema, SetFieldErrorsConfig, SetFieldInputConfig, SetFormErrorsConfig, SetFormInputConfig, type SubmitEventHandler, type SubmitHandler, SwapConfig, UseFieldArrayConfig, UseFieldConfig, type ValidArrayPath, type ValidPath, ValidateFormConfig, type ValidationMode, focus, getAllErrors, getErrors, getInput, handleSubmit, insert, move, remove, replace, reset, setErrors, setInput, submit, swap, useField, useFieldArray, useForm$, useFormQrl, validate };
|
|
1309
|
+
export { type DeepPartial, Field, FieldArray, FieldArrayProps, FieldArrayStore, type FieldElement, FieldElementProps, FieldProps, FieldStore, FocusFieldConfig, Form, type FormConfig, FormProps, type FormSchema, FormStore, GetFieldDirtyInputConfig, GetFieldDirtyPathsConfig, GetFieldErrorsConfig, GetFieldInputConfig, GetFormDirtyInputConfig, GetFormDirtyPathsConfig, GetFormErrorsConfig, GetFormInputConfig, InsertConfig, MoveConfig, type PartialValues, type PathValue, PickDirtyConfig, RemoveConfig, ReplaceConfig, type RequiredPath, ResetFieldConfig, ResetFormConfig, type Schema, SetFieldErrorsConfig, SetFieldInputConfig, SetFormErrorsConfig, SetFormInputConfig, type SubmitEventHandler, type SubmitHandler, SwapConfig, UseFieldArrayConfig, UseFieldConfig, type ValidArrayPath, type ValidPath, ValidateFormConfig, type ValidationMode, focus, getAllErrors, getDirtyInput, getDirtyPaths, getErrors, getInput, handleSubmit, insert, move, pickDirty, remove, replace, reset, setErrors, setInput, submit, swap, useField, useFieldArray, useForm$, useFormQrl, validate };
|
package/dist/index.qwik.js
CHANGED
|
@@ -86,7 +86,7 @@ function initializeFieldStore(internalFieldStore, schema, initialInput, path, nu
|
|
|
86
86
|
if (internalFieldStore.kind === "object") {
|
|
87
87
|
internalFieldStore.children ??= {};
|
|
88
88
|
for (const key in schema.entries) {
|
|
89
|
-
internalFieldStore.children[key]
|
|
89
|
+
internalFieldStore.children[key] ??= {};
|
|
90
90
|
path.push(key);
|
|
91
91
|
initializeFieldStore(internalFieldStore.children[key], schema.entries[key], initialInput?.[key], path);
|
|
92
92
|
path.pop();
|
|
@@ -97,6 +97,7 @@ function initializeFieldStore(internalFieldStore, schema, initialInput, path, nu
|
|
|
97
97
|
internalFieldStore.input = createSignal(objectInput);
|
|
98
98
|
}
|
|
99
99
|
} else {
|
|
100
|
+
if (internalFieldStore.kind && internalFieldStore.kind !== "value") throw new Error(`Store initialized as "${internalFieldStore.kind}" cannot be reinitialized as "value"`);
|
|
100
101
|
internalFieldStore.kind = "value";
|
|
101
102
|
if (internalFieldStore.kind === "value") {
|
|
102
103
|
internalFieldStore.initialInput = createSignal(initialInput);
|
|
@@ -242,6 +243,63 @@ function swapItemState(firstInternalFieldStore, secondInternalFieldStore) {
|
|
|
242
243
|
});
|
|
243
244
|
}
|
|
244
245
|
/**
|
|
246
|
+
* Returns whether the specified boolean property is true for the field store
|
|
247
|
+
* or any of its nested children. Recursively checks arrays and objects.
|
|
248
|
+
*
|
|
249
|
+
* @param internalFieldStore The field store to check.
|
|
250
|
+
* @param type The boolean property type to check.
|
|
251
|
+
*
|
|
252
|
+
* @returns Whether the property is true.
|
|
253
|
+
*/
|
|
254
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
255
|
+
function getFieldBool(internalFieldStore, type) {
|
|
256
|
+
if (internalFieldStore[type].value) return true;
|
|
257
|
+
if (internalFieldStore.kind === "array") {
|
|
258
|
+
for (let index = 0; index < internalFieldStore.items.value.length; index++) if (/* @__PURE__ */ getFieldBool(internalFieldStore.children[index], type)) return true;
|
|
259
|
+
return false;
|
|
260
|
+
}
|
|
261
|
+
if (internalFieldStore.kind == "object") {
|
|
262
|
+
for (const key in internalFieldStore.children) if (/* @__PURE__ */ getFieldBool(internalFieldStore.children[key], type)) return true;
|
|
263
|
+
return false;
|
|
264
|
+
}
|
|
265
|
+
return false;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Returns only the dirty input of the field store. Arrays are treated as
|
|
269
|
+
* atomic and returned in full if any item is dirty, while object keys without
|
|
270
|
+
* a dirty descendant are omitted. Returns `undefined` if no descendant is
|
|
271
|
+
* dirty.
|
|
272
|
+
*
|
|
273
|
+
* @param internalFieldStore The field store to get dirty input from.
|
|
274
|
+
* @param dirtyOnly Whether to only include dirty fields. Defaults to `true`.
|
|
275
|
+
*
|
|
276
|
+
* @returns The dirty input, or `undefined` if no descendant is dirty.
|
|
277
|
+
*/
|
|
278
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
279
|
+
function getDirtyFieldInput(internalFieldStore, dirtyOnly = true) {
|
|
280
|
+
if (dirtyOnly && !/* @__PURE__ */ getFieldBool(internalFieldStore, "isDirty")) return;
|
|
281
|
+
if (internalFieldStore.kind === "array") {
|
|
282
|
+
if (internalFieldStore.input.value) {
|
|
283
|
+
const value = [];
|
|
284
|
+
for (let index = 0; index < internalFieldStore.items.value.length; index++) value[index] = /* @__PURE__ */ getDirtyFieldInput(internalFieldStore.children[index], false);
|
|
285
|
+
return value;
|
|
286
|
+
}
|
|
287
|
+
return internalFieldStore.input.value;
|
|
288
|
+
}
|
|
289
|
+
if (internalFieldStore.kind === "object") {
|
|
290
|
+
if (internalFieldStore.input.value) {
|
|
291
|
+
const value = {};
|
|
292
|
+
for (const key in internalFieldStore.children) {
|
|
293
|
+
const child = internalFieldStore.children[key];
|
|
294
|
+
if (!dirtyOnly || /* @__PURE__ */ getFieldBool(child, "isDirty")) value[key] = /* @__PURE__ */ getDirtyFieldInput(child, dirtyOnly);
|
|
295
|
+
}
|
|
296
|
+
return value;
|
|
297
|
+
}
|
|
298
|
+
return internalFieldStore.input.value;
|
|
299
|
+
}
|
|
300
|
+
return internalFieldStore.input.value;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
245
303
|
* Returns the current input of the field store. For arrays and objects,
|
|
246
304
|
* recursively collects input from all children. Returns `null` or `undefined`
|
|
247
305
|
* for nullish array/object inputs, or the primitive value for value fields.
|
|
@@ -298,28 +356,6 @@ function getElementInput(element, internalFieldStore) {
|
|
|
298
356
|
return element.value;
|
|
299
357
|
}
|
|
300
358
|
/**
|
|
301
|
-
* Returns whether the specified boolean property is true for the field store
|
|
302
|
-
* or any of its nested children. Recursively checks arrays and objects.
|
|
303
|
-
*
|
|
304
|
-
* @param internalFieldStore The field store to check.
|
|
305
|
-
* @param type The boolean property type to check.
|
|
306
|
-
*
|
|
307
|
-
* @returns Whether the property is true.
|
|
308
|
-
*/
|
|
309
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
310
|
-
function getFieldBool(internalFieldStore, type) {
|
|
311
|
-
if (internalFieldStore[type].value) return true;
|
|
312
|
-
if (internalFieldStore.kind === "array") {
|
|
313
|
-
for (let index = 0; index < internalFieldStore.items.value.length; index++) if (/* @__PURE__ */ getFieldBool(internalFieldStore.children[index], type)) return true;
|
|
314
|
-
return false;
|
|
315
|
-
}
|
|
316
|
-
if (internalFieldStore.kind == "object") {
|
|
317
|
-
for (const key in internalFieldStore.children) if (/* @__PURE__ */ getFieldBool(internalFieldStore.children[key], type)) return true;
|
|
318
|
-
return false;
|
|
319
|
-
}
|
|
320
|
-
return false;
|
|
321
|
-
}
|
|
322
|
-
/**
|
|
323
359
|
* Returns the field store at the specified path by traversing the form store's
|
|
324
360
|
* children hierarchy.
|
|
325
361
|
*
|
|
@@ -576,6 +612,17 @@ function getAllErrors(form) {
|
|
|
576
612
|
return allErrors;
|
|
577
613
|
}
|
|
578
614
|
/* @__NO_SIDE_EFFECTS__ */
|
|
615
|
+
function getDirtyInput(form, config) {
|
|
616
|
+
return getDirtyFieldInput(config?.path ? getFieldStore(form[INTERNAL], config.path) : form[INTERNAL]);
|
|
617
|
+
}
|
|
618
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
619
|
+
function getDirtyPaths(form, config) {
|
|
620
|
+
config?.path ? getFieldStore(form[INTERNAL], config.path) : form[INTERNAL];
|
|
621
|
+
const paths = [];
|
|
622
|
+
config?.path && [...config.path];
|
|
623
|
+
return paths;
|
|
624
|
+
}
|
|
625
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
579
626
|
function getErrors(form, config) {
|
|
580
627
|
return (config?.path ? getFieldStore(form[INTERNAL], config.path) : form[INTERNAL]).errors.value;
|
|
581
628
|
}
|
|
@@ -669,6 +716,48 @@ function move(form, config) {
|
|
|
669
716
|
});
|
|
670
717
|
}
|
|
671
718
|
/**
|
|
719
|
+
* Picks only the dirty parts of the given value, using the form's dirty fields
|
|
720
|
+
* as a structural mask. Arrays are treated as atomic and object keys without a
|
|
721
|
+
* dirty descendant are omitted. Returns `undefined` if no field is dirty.
|
|
722
|
+
* Useful for filtering a validated output down to its changed parts before
|
|
723
|
+
* submitting.
|
|
724
|
+
*
|
|
725
|
+
* @param form The form store providing the dirty mask.
|
|
726
|
+
* @param config The pick dirty configuration.
|
|
727
|
+
*
|
|
728
|
+
* @returns The dirty parts of the value, or `undefined`.
|
|
729
|
+
*/
|
|
730
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
731
|
+
function pickDirty(form, config) {
|
|
732
|
+
if (!getFieldBool(form[INTERNAL], "isDirty")) return;
|
|
733
|
+
const result = /* @__PURE__ */ pickFieldValue(form[INTERNAL], config.from);
|
|
734
|
+
return Object.keys(result).length ? result : void 0;
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* Recursively picks the dirty parts of a value using the field store as a
|
|
738
|
+
* structural mask, reading from the supplied value rather than the form's own
|
|
739
|
+
* input. Objects with non-nullish input recurse into their dirty children that
|
|
740
|
+
* are present in the value, while arrays, primitives, nullish-cleared fields
|
|
741
|
+
* and shape-diverging values are returned as-is.
|
|
742
|
+
*
|
|
743
|
+
* @param internalFieldStore The field store used as the dirty mask.
|
|
744
|
+
* @param value The value to pick the dirty parts from.
|
|
745
|
+
*
|
|
746
|
+
* @returns The dirty parts of the value.
|
|
747
|
+
*/
|
|
748
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
749
|
+
function pickFieldValue(internalFieldStore, value) {
|
|
750
|
+
if (internalFieldStore.kind === "object" && internalFieldStore.input.value && value && typeof value === "object" && !Array.isArray(value)) {
|
|
751
|
+
const result = {};
|
|
752
|
+
for (const key in internalFieldStore.children) {
|
|
753
|
+
const child = internalFieldStore.children[key];
|
|
754
|
+
if (getFieldBool(child, "isDirty") && key in value) result[key] = /* @__PURE__ */ pickFieldValue(child, value[key]);
|
|
755
|
+
}
|
|
756
|
+
return result;
|
|
757
|
+
}
|
|
758
|
+
return value;
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
672
761
|
* Removes an item from a field array at the specified index. All items after
|
|
673
762
|
* the removed item are shifted down by one index.
|
|
674
763
|
*
|
|
@@ -714,7 +803,7 @@ function reset(form, config) {
|
|
|
714
803
|
untrack(() => {
|
|
715
804
|
const internalFormStore = form[INTERNAL];
|
|
716
805
|
const internalFieldStore = config?.path ? getFieldStore(internalFormStore, config.path) : internalFormStore;
|
|
717
|
-
if (config
|
|
806
|
+
if (config && "initialInput" in config) setInitialFieldInput(internalFieldStore, config.initialInput);
|
|
718
807
|
walkFieldStore(internalFieldStore, (internalFieldStore$1) => {
|
|
719
808
|
internalFieldStore$1.elements = internalFieldStore$1.initialElements;
|
|
720
809
|
if (!config?.keepErrors) internalFieldStore$1.errors.value = null;
|
|
@@ -995,4 +1084,4 @@ const Form = component$(({ of, onSubmit$,...other }) => {
|
|
|
995
1084
|
});
|
|
996
1085
|
|
|
997
1086
|
//#endregion
|
|
998
|
-
export { Field, FieldArray, Form, focus, getAllErrors, getErrors, getInput, handleSubmit, insert, move, remove, replace, reset, setErrors, setInput, submit, swap, useField, useFieldArray, useForm$, useFormQrl, validate };
|
|
1087
|
+
export { Field, FieldArray, Form, focus, getAllErrors, getDirtyInput, getDirtyPaths, getErrors, getInput, handleSubmit, insert, move, pickDirty, remove, replace, reset, setErrors, setInput, submit, swap, useField, useFieldArray, useForm$, useFormQrl, validate };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formisch/qwik",
|
|
3
|
-
"description": "The
|
|
4
|
-
"version": "0.
|
|
3
|
+
"description": "The lightweight, schema-first, and fully type-safe form library for Qwik",
|
|
4
|
+
"version": "0.11.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Fabian Hiller",
|
|
7
7
|
"homepage": "https://formisch.dev",
|
|
@@ -55,14 +55,14 @@
|
|
|
55
55
|
"prettier": "3.6.2",
|
|
56
56
|
"tsdown": "0.12.9",
|
|
57
57
|
"typescript": "5.8.3",
|
|
58
|
-
"valibot": "^1.
|
|
58
|
+
"valibot": "^1.4.1",
|
|
59
59
|
"vite": "7.0.4",
|
|
60
60
|
"vite-tsconfig-paths": "^5.1.4"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@qwik.dev/core": ">=2",
|
|
64
64
|
"typescript": ">=5",
|
|
65
|
-
"valibot": "^1.
|
|
65
|
+
"valibot": "^1.4.1"
|
|
66
66
|
},
|
|
67
67
|
"peerDependenciesMeta": {
|
|
68
68
|
"typescript": {
|