@formisch/qwik 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +16 -12
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
import { JSXOutput, NoSerialize, PropsOf, QRL, ReadonlySignal } from "@qwik.dev/core";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _qwik_dev_core_internal1 from "@qwik.dev/core/internal";
|
|
4
4
|
|
|
5
5
|
//#region ../../packages/core/dist/index.qwik.d.ts
|
|
6
6
|
|
|
@@ -201,23 +201,27 @@ declare const INTERNAL: "~internal";
|
|
|
201
201
|
/**
|
|
202
202
|
* Checks if a type is `any`.
|
|
203
203
|
*/
|
|
204
|
-
type IsAny<
|
|
204
|
+
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
205
205
|
/**
|
|
206
206
|
* Checks if a type is `never`.
|
|
207
207
|
*/
|
|
208
|
-
type IsNever<
|
|
208
|
+
type IsNever<T> = [T] extends [never] ? true : false;
|
|
209
209
|
/**
|
|
210
210
|
* Constructs a type that is maybe a promise.
|
|
211
211
|
*/
|
|
212
|
-
type MaybePromise<
|
|
212
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
213
213
|
/**
|
|
214
214
|
* Makes all properties deeply optional.
|
|
215
215
|
*/
|
|
216
|
-
type DeepPartial<TValue> = TValue extends Record<PropertyKey, unknown> | readonly unknown[] ? { [
|
|
216
|
+
type DeepPartial<TValue> = TValue extends Record<PropertyKey, unknown> | readonly unknown[] ? { [TKey in keyof TValue]?: DeepPartial<TValue[TKey]> | undefined } : TValue | undefined;
|
|
217
217
|
/**
|
|
218
218
|
* Makes all value properties optional.
|
|
219
|
+
*
|
|
220
|
+
* Hint: For dynamic arrays, only plain objects and nested arrays have their
|
|
221
|
+
* values made optional. Primitives and class instances are kept as-is to avoid
|
|
222
|
+
* types like `(string | undefined)[]`.
|
|
219
223
|
*/
|
|
220
|
-
type PartialValues<TValue> = TValue extends Record<PropertyKey, unknown> | readonly unknown[] ? { [
|
|
224
|
+
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;
|
|
221
225
|
//#endregion
|
|
222
226
|
//#region src/types/form.d.ts
|
|
223
227
|
/**
|
|
@@ -262,7 +266,7 @@ interface InternalFormStore<TSchema extends Schema = Schema> extends InternalObj
|
|
|
262
266
|
/**
|
|
263
267
|
* The element of the form.
|
|
264
268
|
*/
|
|
265
|
-
element?: HTMLFormElement;
|
|
269
|
+
element?: HTMLFormElement | undefined;
|
|
266
270
|
/**
|
|
267
271
|
* The number of active validators.
|
|
268
272
|
*/
|
|
@@ -328,7 +332,7 @@ type KeyOf<TValue> = IsAny<TValue> extends true ? never : TValue extends readonl
|
|
|
328
332
|
* properties that do not exist in all union options are not accessible
|
|
329
333
|
* and result in "any" when accessed.
|
|
330
334
|
*/
|
|
331
|
-
type MergeUnion<
|
|
335
|
+
type MergeUnion<TValue> = { [TKey in KeyOf<TValue>]: TValue extends Record<TKey, infer TItem> ? TItem : never };
|
|
332
336
|
/**
|
|
333
337
|
* Lazily evaluates only the first valid path segment based on the given value.
|
|
334
338
|
*/
|
|
@@ -660,7 +664,7 @@ interface ResetFieldConfig<TSchema extends Schema, TFieldPath extends RequiredPa
|
|
|
660
664
|
* The new initial input to reset the field to. If provided, replaces the
|
|
661
665
|
* field's initial input.
|
|
662
666
|
*/
|
|
663
|
-
readonly initialInput?: DeepPartial<PathValue<v.InferInput<TSchema>, TFieldPath
|
|
667
|
+
readonly initialInput?: DeepPartial<PathValue<v.InferInput<TSchema>, TFieldPath>> | undefined;
|
|
664
668
|
}
|
|
665
669
|
/**
|
|
666
670
|
* Resets a specific field or the entire form to its initial state. Provides
|
|
@@ -985,7 +989,7 @@ interface FieldProps<TSchema extends Schema = Schema, TFieldPath extends Require
|
|
|
985
989
|
*
|
|
986
990
|
* @returns The UI of the field to be rendered.
|
|
987
991
|
*/
|
|
988
|
-
declare const Field: <TSchema extends Schema, TFieldPath extends RequiredPath>(props:
|
|
992
|
+
declare const Field: <TSchema extends Schema, TFieldPath extends RequiredPath>(props: _qwik_dev_core_internal1.PublicProps<FieldProps<TSchema, TFieldPath>>, key: string | null, flags: number, dev?: _qwik_dev_core_internal1.DevJSX) => JSXOutput;
|
|
989
993
|
//#endregion
|
|
990
994
|
//#region src/components/FieldArray/FieldArray.d.ts
|
|
991
995
|
/**
|
|
@@ -1013,7 +1017,7 @@ interface FieldArrayProps<TSchema extends Schema = Schema, TFieldArrayPath exten
|
|
|
1013
1017
|
*
|
|
1014
1018
|
* @returns The UI of the field array to be rendered.
|
|
1015
1019
|
*/
|
|
1016
|
-
declare const FieldArray: <TSchema extends Schema, TFieldArrayPath extends RequiredPath>(props:
|
|
1020
|
+
declare const FieldArray: <TSchema extends Schema, TFieldArrayPath extends RequiredPath>(props: _qwik_dev_core_internal1.PublicProps<FieldArrayProps<TSchema, TFieldArrayPath>>, key: string | null, flags: number, dev?: _qwik_dev_core_internal1.DevJSX) => JSXOutput;
|
|
1017
1021
|
//#endregion
|
|
1018
1022
|
//#region src/components/Form/Form.d.ts
|
|
1019
1023
|
/**
|
|
@@ -1035,7 +1039,7 @@ type FormProps<TSchema extends Schema = Schema> = Omit<PropsOf<'form'>, 'onSubmi
|
|
|
1035
1039
|
*
|
|
1036
1040
|
* @returns The a native form element.
|
|
1037
1041
|
*/
|
|
1038
|
-
declare const Form: <TSchema extends Schema>(props:
|
|
1042
|
+
declare const Form: <TSchema extends Schema>(props: _qwik_dev_core_internal1.PublicProps<FormProps<TSchema>>, key: string | null, flags: number, dev?: _qwik_dev_core_internal1.DevJSX) => JSXOutput;
|
|
1039
1043
|
//#endregion
|
|
1040
1044
|
//#region src/hooks/useField/useField.d.ts
|
|
1041
1045
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formisch/qwik",
|
|
3
3
|
"description": "The modular and type-safe form library for Qwik",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.3",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Fabian Hiller",
|
|
7
7
|
"homepage": "https://formisch.dev",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"valibot": "^1.2.0",
|
|
48
48
|
"vite": "7.0.4",
|
|
49
49
|
"vite-tsconfig-paths": "^5.1.4",
|
|
50
|
-
"@formisch/core": "0.6.
|
|
51
|
-
"@formisch/
|
|
52
|
-
"@formisch/
|
|
50
|
+
"@formisch/core": "0.6.2",
|
|
51
|
+
"@formisch/methods": "0.7.0",
|
|
52
|
+
"@formisch/eslint-config": "0.1.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@qwik.dev/core": ">=2",
|