notform 4.0.1 → 4.1.0-alpha.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.
@@ -0,0 +1,462 @@
1
+ import { Component, MaybeRefOrGetter } from "vue";
2
+ import { StandardSchemaV1 } from "@standard-schema/spec";
3
+ import { Get, PartialDeep, Paths } from "type-fest";
4
+ /**
5
+ * A Standard Schema whose input AND output are objects.
6
+ *
7
+ * Forms require this because form values are always a keyed object, never a
8
+ * lone string or number.
9
+ */
10
+ type FormSchema = StandardSchemaV1 & {
11
+ '~standard': StandardSchemaV1['~standard'] & {
12
+ types?: {
13
+ input: object;
14
+ output: object;
15
+ };
16
+ };
17
+ };
18
+ /**
19
+ * The data a schema *accepts*: what the user types, before parsing,
20
+ * transforming or defaults. This is the shape of `form.values`.
21
+ * @template TSchema - Any Standard Schema compatible schema (Zod, Valibot, ArkType, ...).
22
+ * @example
23
+ * // A schema that turns the text '42' into the number 42:
24
+ * // SchemaInput -> { age: string }
25
+ * // SchemaOutput -> { age: number }
26
+ */
27
+ type SchemaInput<TSchema extends StandardSchemaV1> = StandardSchemaV1.InferInput<TSchema>;
28
+ /**
29
+ * The data a schema *produces* after a successful validation. This is the shape `onSubmit` receives.
30
+ * @template TSchema - Any Standard Schema compatible schema.
31
+ */
32
+ type SchemaOutput<TSchema extends StandardSchemaV1> = StandardSchemaV1.InferOutput<TSchema>;
33
+ /**
34
+ * @file
35
+ * Vocabulary used across the library:
36
+ *
37
+ * - PATH A location written as dot-notation text, e.g. 'address.city' or 'tags.0'.
38
+ * This is what you pass to `form.field()`.
39
+ *
40
+ * - SEGMENTS The same location split into steps, e.g. ['address', 'city'] or ['tags', 0].
41
+ * Schema libraries report issue locations this way.
42
+ */
43
+ /**
44
+ * The item type of an array type. `never` when `TArray` is not an array.
45
+ * @template TArray - An array type, optionally `null` / `undefined`.
46
+ * @example
47
+ * // ArrayItem<string[] | undefined> -> string
48
+ */
49
+ type ArrayItem<TArray> = NonNullable<TArray> extends readonly (infer TItem)[] ? TItem : never;
50
+ /**
51
+ * Every valid path into the schema's INPUT data that points at an array.
52
+ * These are the paths accepted by `form.arrayField()`.
53
+ * @template TSchema - Any Standard Schema compatible schema.
54
+ */
55
+ type InputArrayPath<TSchema extends StandardSchemaV1> = ValueArrayPath<SchemaInput<TSchema>>;
56
+ /**
57
+ * Every valid path into the schema's INPUT data (the shape of `form.values`).
58
+ * These are the paths accepted by `form.field()` and `form.setValue()`.
59
+ * @template TSchema - Any Standard Schema compatible schema.
60
+ * @example
61
+ * // For z.object({ email: z.string(), tags: z.array(z.string()) }):
62
+ * // 'email' | 'tags' | `tags.${number}`
63
+ */
64
+ type InputPath<TSchema extends StandardSchemaV1> = ValuePath<SchemaInput<TSchema>>;
65
+ /**
66
+ * The type of the INPUT value found at `TPath`.
67
+ * @template TSchema - Any Standard Schema compatible schema.
68
+ * @template TPath - Dot-notation path, e.g. `'address.city'`.
69
+ */
70
+ type InputPathValue<TSchema extends StandardSchemaV1, TPath extends string> = ValuePathValue<SchemaInput<TSchema>, TPath>;
71
+ /**
72
+ * Every valid path into the schema's OUTPUT data (the shape `onSubmit` receives).
73
+ * @template TSchema - Any Standard Schema compatible schema.
74
+ */
75
+ type OutputPath<TSchema extends StandardSchemaV1> = ValuePath<SchemaOutput<TSchema>>;
76
+ /**
77
+ * The type of the OUTPUT value found at `TPath`.
78
+ * @template TSchema - Any Standard Schema compatible schema.
79
+ * @template TPath - Dot-notation path.
80
+ */
81
+ type OutputPathValue<TSchema extends StandardSchemaV1, TPath extends string> = ValuePathValue<SchemaOutput<TSchema>, TPath>;
82
+ /**
83
+ * Every dot-notation path inside `TValue` that points at an array.
84
+ * @template TValue - The object type to look into.
85
+ */
86
+ type ValueArrayPath<TValue> = Extract<ArrayPathsOf<TValue, ValuePath<TValue>>, string>;
87
+ /**
88
+ * Every dot-notation path inside `TValue`.
89
+ * @template TValue - The object type to look into.
90
+ * @remarks Recursion is capped at depth 10 to keep TypeScript fast.
91
+ */
92
+ type ValuePath<TValue> = Extract<Paths<TValue, {
93
+ maxRecursionDepth: 10;
94
+ }>, string>;
95
+ /**
96
+ * The type found at `TPath` inside `TValue`.
97
+ * @template TValue - The object type to look into.
98
+ * @template TPath - Dot-notation path.
99
+ */
100
+ type ValuePathValue<TValue, TPath extends string> = Get<TValue, TPath, {
101
+ strict: false;
102
+ }>;
103
+ /** Keeps only the paths whose value is an array (distributes over the path union). */
104
+ type ArrayPathsOf<TValue, TPath extends string> = TPath extends unknown ? NonNullable<ValuePathValue<TValue, TPath>> extends readonly unknown[] ? TPath : never : never;
105
+ /**
106
+ * A single validation problem reported by a schema: a human-readable `message`
107
+ * and an optional `path` (in segments). An issue without a `path` applies to the whole form.
108
+ */
109
+ type ValidationIssue = StandardSchemaV1.Issue;
110
+ /**
111
+ * The raw Standard Schema result: `{ value }` on success, `{ issues }` on failure.
112
+ * @template TValue - Type of the validated value on success.
113
+ */
114
+ type ValidationResult<TValue> = StandardSchemaV1.Result<TValue>;
115
+ /**
116
+ * Per-field behavior, passed as the second argument of `form.field()` / `form.arrayField()`.
117
+ * @remarks Read once, when the field is first created.
118
+ * @example
119
+ * form.field('email', { debounce: 300, validateOn: { input: true } })
120
+ */
121
+ type FieldConfig = {
122
+ /** Milliseconds to wait after the last `input` / `change` before validating. `blur` always validates immediately. */
123
+ debounce?: number;
124
+ /** Which events trigger validation. Omitted events keep their defaults (`blur` and `change` on, `input` off). */
125
+ validateOn?: Partial<Record<FieldValidationEvent, boolean>>;
126
+ /**
127
+ * - `'eager'`: once the field has errors, every `input` and `change` re-validates it,
128
+ * so the error disappears as soon as the value is fixed.
129
+ *
130
+ * - `'lazy'`: only the events enabled in `validateOn` validate.
131
+ * @default 'eager'
132
+ */
133
+ validationMode?: 'eager' | 'lazy';
134
+ };
135
+ /** Handlers to spread onto an input: `<input v-bind="field.events">`. */
136
+ type FieldEvents = Record<`on${Capitalize<FieldValidationEvent>}`, () => void>;
137
+ /**
138
+ * A single form field, bound to one value inside the form.
139
+ *
140
+ * Created by `form.field('some.path')`. The instance is cached, so asking for the
141
+ * same path again returns the same field with the same `id`.
142
+ * @template TValue - Type of the value this field holds.
143
+ */
144
+ type FieldInstance<TValue> = {
145
+ /** Issues reported exactly at this field's path (not those of nested fields). */
146
+ errors: ValidationIssue[];
147
+ /** Handlers for `blur` / `change` / `input`; they mark the field touched and trigger validation. */
148
+ events: FieldEvents;
149
+ /** Stable identity. Safe as a `v-for` key; does not change when the field's path does. */
150
+ id: symbol;
151
+ /** `true` when the value differs (deep comparison) from the initial value at the field's path. */
152
+ isDirty: boolean;
153
+ /** `true` once the field was blurred, or the form was submitted. */
154
+ isTouched: boolean;
155
+ /** `true` when {@link FieldInstance.errors} is empty. */
156
+ isValid: boolean;
157
+ /** `true` while this field, a field nested in it, or the whole form is being validated. */
158
+ isValidating: boolean;
159
+ /** The field's value. Assign to it (or `v-model` it) to write straight into `form.values`. */
160
+ model: TValue;
161
+ /** Current dot-notation location, e.g. `'address.city'`. Follows the field when array items move. */
162
+ path: string;
163
+ /**
164
+ * Validates this field now, skipping any pending debounce.
165
+ * @returns `{ value }` with the current value, or `{ issues }` for this field.
166
+ */
167
+ validate: () => Promise<ValidationResult<TValue>>;
168
+ };
169
+ /**
170
+ * Props of the `<Field>` component.
171
+ * @template TValue - Type of the value the field holds.
172
+ */
173
+ type FieldProps<TValue> = {
174
+ /** The field created by `form.field('some.path')`, or an array item. */
175
+ field: FieldInstance<TValue>;
176
+ };
177
+ /**
178
+ * Slots of the `<Field>` component.
179
+ * @template TValue - Type of the value the field holds.
180
+ */
181
+ type FieldSlots<TValue> = {
182
+ /** Receives the `field`. Extra attributes set on `<Field>` arrive as additional slot props. */
183
+ default?: (props: {
184
+ field: FieldInstance<TValue>;
185
+ }) => void;
186
+ };
187
+ /** Events that can trigger a field's validation. See {@link FieldConfig.validateOn}. */
188
+ type FieldValidationEvent = 'blur' | 'change' | 'input';
189
+ /**
190
+ * A field for an array: the usual field state for the array itself (`errors` are
191
+ * array-level issues such as "at least one item"), plus the list of items and
192
+ * the mutations to change it.
193
+ *
194
+ * Mutate through this object (not `values.list.push()`) so items keep their identity,
195
+ * touched state and errors. Inserted values are deep-cloned.
196
+ * @template TItem - Type of one array item.
197
+ */
198
+ type ArrayFieldInstance<TItem> = FieldInstance<TItem[]> & {
199
+ /**
200
+ * Adds an item at the end.
201
+ * @param value The new item.
202
+ */
203
+ append: (value: TItem) => void;
204
+ /**
205
+ * Adds an item at `index`; later items shift up.
206
+ * @param index Where to insert. Clamped into `0..length`.
207
+ * @param value The new item.
208
+ */
209
+ insert: (index: number, value: TItem) => void;
210
+ /** One entry per array item, in order. Use `item.id` as the `v-for` key. */
211
+ items: ArrayItemInstance<TItem>[];
212
+ /**
213
+ * Moves an item to another position. Ignored if an index is out of range.
214
+ * @param from Current index of the item.
215
+ * @param to Index it should end up at.
216
+ */
217
+ move: (from: number, to: number) => void;
218
+ /**
219
+ * Adds an item at the start.
220
+ * @param value The new item.
221
+ */
222
+ prepend: (value: TItem) => void;
223
+ /**
224
+ * Removes an item. Ignored if `index` is out of range.
225
+ * @param index Index of the item.
226
+ */
227
+ remove: (index: number) => void;
228
+ /**
229
+ * Swaps two items. Ignored if an index is out of range.
230
+ * @param indexA Index of the first item.
231
+ * @param indexB Index of the second item.
232
+ */
233
+ swap: (indexA: number, indexB: number) => void;
234
+ /**
235
+ * Replaces an item in place. The item keeps its id and touched state; its old errors are dropped.
236
+ * Ignored if `index` is out of range.
237
+ * @param index Index of the item.
238
+ * @param value The new value.
239
+ */
240
+ update: (index: number, value: TItem) => void;
241
+ };
242
+ /**
243
+ * Props of the `<ArrayField>` component.
244
+ * @template TItem - Type of one array item.
245
+ */
246
+ type ArrayFieldProps<TItem> = {
247
+ /** The array field created by `form.arrayField('some.path')`. */
248
+ arrayField: ArrayFieldInstance<TItem>;
249
+ };
250
+ /**
251
+ * Slots of the `<ArrayField>` component.
252
+ * @template TItem - Type of one array item.
253
+ */
254
+ type ArrayFieldSlots<TItem> = {
255
+ /** Receives the `arrayField`. Extra attributes set on `<ArrayField>` arrive as additional slot props. */
256
+ default?: (props: {
257
+ arrayField: ArrayFieldInstance<TItem>;
258
+ }) => void;
259
+ };
260
+ /**
261
+ * One item of an array field. It is a regular field for the item's value (pass it
262
+ * straight to `<Field>`), plus its position and shortcuts to change it.
263
+ *
264
+ * Its `id` never changes; `index` and `path` follow the item when the array is reordered.
265
+ * @template TItem - Type of the item.
266
+ */
267
+ type ArrayItemInstance<TItem> = FieldInstance<TItem> & {
268
+ /**
269
+ * Creates an array field nested in this item (e.g. a `tags` list inside a contact).
270
+ * Cached per path; follows the item when it moves.
271
+ * @param path Path relative to the item, e.g. `'tags'`.
272
+ * @param config Optional per-field behavior.
273
+ * @returns The nested array field.
274
+ */
275
+ arrayField: <TPath extends ValueArrayPath<TItem>>(path: TPath, config?: FieldConfig) => ArrayFieldInstance<ArrayItem<ValuePathValue<TItem, TPath>>>;
276
+ /**
277
+ * Creates a field nested in this item (e.g. `'email'` inside a contact).
278
+ * Cached per path; follows the item when it moves.
279
+ * @param path Path relative to the item, e.g. `'email'`.
280
+ * @param config Optional per-field behavior.
281
+ * @returns The nested field.
282
+ */
283
+ field: <TPath extends ValuePath<TItem>>(path: TPath, config?: FieldConfig) => FieldInstance<ValuePathValue<TItem, TPath>>;
284
+ /** Current position in the array. */
285
+ index: number;
286
+ };
287
+ /** Props of the `<FieldError>` component. */
288
+ type FieldErrorProps = {
289
+ /**
290
+ * HTML tag name or Vue component used to render the message.
291
+ * @default 'span'
292
+ */
293
+ as?: Component | string;
294
+ /** A list of issues, or anything that has one (a field, an array field, an array item). Only the first message is shown. */
295
+ errors: ValidationIssue[] | {
296
+ readonly errors: ValidationIssue[];
297
+ };
298
+ };
299
+ /** Slots of the `<FieldError>` component. */
300
+ type FieldErrorSlots = {
301
+ /** Receives the `message` to display. */
302
+ default?: (props: {
303
+ message?: string;
304
+ }) => void;
305
+ };
306
+ /**
307
+ * Makes every property optional, at every depth (including items inside arrays).
308
+ *
309
+ * Used for initial form values: a form can start empty or half-filled even
310
+ * though the schema eventually demands complete data.
311
+ * @template TValue - The type to make deeply optional.
312
+ */
313
+ type DeepPartial<TValue> = PartialDeep<TValue, {
314
+ allowUndefinedInNonTupleArrays: true;
315
+ recurseIntoArrays: true;
316
+ }>;
317
+ /**
318
+ * Options accepted by `useForm()`.
319
+ * @template TSchema - The schema describing the form's data (must be an object schema).
320
+ */
321
+ type FormConfig<TSchema extends FormSchema> = {
322
+ /** Errors to show from the start (e.g. returned by the server). */
323
+ initialErrors?: ValidationIssue[];
324
+ /** Values to start with. May be partial; the schema is only enforced on validation. */
325
+ initialValues?: DeepPartial<SchemaInput<TSchema>>;
326
+ /** Called with the validated, parsed data after a successful submit. */
327
+ onSubmit?: (data: SchemaOutput<TSchema>) => Promise<void> | void;
328
+ /** The schema to validate against. Accepts a value, a ref, or a getter, so it can change reactively. */
329
+ schema: MaybeRefOrGetter<TSchema>;
330
+ };
331
+ /**
332
+ * A reactive form: its values, errors, state flags, and the actions to change them.
333
+ * @template TSchema - The schema describing the form's data (must be an object schema).
334
+ */
335
+ type FormInstance<TSchema extends FormSchema> = {
336
+ /**
337
+ * Gets or creates the array field at `path`. Cached: the same path always returns the same field.
338
+ * @param path Dot-notation path to an array, e.g. `'tags'`.
339
+ * @param config Optional per-field behavior, read when the field is first created.
340
+ * @returns A reactive array field to pass to `<ArrayField>`.
341
+ */
342
+ arrayField: <TPath extends InputArrayPath<TSchema>>(path: TPath, config?: FieldConfig) => ArrayFieldInstance<ArrayItem<InputPathValue<TSchema, TPath>>>;
343
+ /** Removes every error from the form. */
344
+ clearErrors: () => void;
345
+ /** Current validation errors of the whole form. Empty when everything is valid. */
346
+ errors: ValidationIssue[];
347
+ /**
348
+ * Gets or creates the field at `path`. Cached: the same path always returns the
349
+ * same field (same `id`, same touched state), so it is safe to call inside a template.
350
+ * @param path Dot-notation path to the value, e.g. `'address.city'`.
351
+ * @param config Optional per-field behavior, read when the field is first created.
352
+ * @returns A reactive field to pass to `<Field>`.
353
+ */
354
+ field: <TPath extends InputPath<TSchema>>(path: TPath, config?: FieldConfig) => FieldInstance<InputPathValue<TSchema, TPath>>;
355
+ /**
356
+ * Reads the issues reported exactly at `path`.
357
+ * @param path Dot-notation path.
358
+ * @returns The matching issues.
359
+ */
360
+ getFieldErrors: <TPath extends InputPath<TSchema>>(path: TPath) => ValidationIssue[];
361
+ /**
362
+ * Reads the live value at `path`.
363
+ * @param path Dot-notation path.
364
+ * @returns The current value.
365
+ */
366
+ getValue: <TPath extends InputPath<TSchema>>(path: TPath) => InputPathValue<TSchema, TPath>;
367
+ /** The errors the form started with. Replaced as a whole by `reset(values, errors)`. */
368
+ initialErrors: ValidationIssue[];
369
+ /** The values the form started with; `isDirty` compares against them. Replaced as a whole by `reset(values)`. */
370
+ initialValues: DeepPartial<SchemaInput<TSchema>>;
371
+ /** `true` when `values` differ (deep comparison) from `initialValues`. */
372
+ isDirty: boolean;
373
+ /**
374
+ * Tells whether a validation concerning `path` is running: a whole-form run, a run on
375
+ * the path itself, or a run on a field nested inside it.
376
+ * @param path Dot-notation path.
377
+ * @returns `true` while one is running.
378
+ */
379
+ isFieldValidating: <TPath extends InputPath<TSchema>>(path: TPath) => boolean;
380
+ /** `true` once a submit was attempted, even if validation failed. */
381
+ isSubmitted: boolean;
382
+ /** `true` while a submit is running (validating, or waiting for `onSubmit`). */
383
+ isSubmitting: boolean;
384
+ /** `true` once any field was blurred or a submit was attempted. */
385
+ isTouched: boolean;
386
+ /** `true` when there are no errors. Reflects the last validation; reading it does not validate. */
387
+ isValid: boolean;
388
+ /** `true` while any validation is running. */
389
+ isValidating: boolean;
390
+ /**
391
+ * Replaces all current errors.
392
+ * @param nextErrors The errors the form should now show (e.g. from the server).
393
+ */
394
+ replaceErrors: (nextErrors: ValidationIssue[]) => void;
395
+ /**
396
+ * Resets values, errors, touched state and submit state, and cancels pending validations.
397
+ * Array items get fresh identities.
398
+ * @param nextValues New starting values. Omit to go back to the current `initialValues`.
399
+ * @param nextErrors New starting errors. Omit to go back to the current `initialErrors`.
400
+ */
401
+ reset: {
402
+ (nextValues?: DeepPartial<SchemaInput<TSchema>>, nextErrors?: ValidationIssue[]): void;
403
+ /** Overload so it can be used directly as an event handler: `@reset.prevent="form.reset"`. */
404
+ (event: Event): void;
405
+ };
406
+ /** How many times the form was reset. Handy as a `:key` to remount inputs. */
407
+ resetCount: number;
408
+ /**
409
+ * Sets an error. Replaces the errors already on the same path.
410
+ * @param error The issue to show. Without a `path` it is a form-level error.
411
+ */
412
+ setError: (error: ValidationIssue) => void;
413
+ /**
414
+ * Writes `value` into the form at `path`.
415
+ * @param path Dot-notation path.
416
+ * @param value The new value (typed from the schema).
417
+ */
418
+ setValue: <TPath extends InputPath<TSchema>>(path: TPath, value: InputPathValue<TSchema, TPath>) => void;
419
+ /**
420
+ * Validates the whole form and, if valid, calls `onSubmit`. Safe to use as a `<form v-on:submit>` handler.
421
+ * Ignored while a submit is already running.
422
+ * @param event The browser submit event; its default page reload is prevented.
423
+ * @returns Resolves when the submit finished. Rejects with whatever `onSubmit` throws.
424
+ */
425
+ submit: (event?: SubmitEvent) => Promise<void>;
426
+ /** How many times a submit was attempted. */
427
+ submitCount: number;
428
+ /**
429
+ * Validates the whole form and replaces all errors with the outcome. Does not call `onSubmit`.
430
+ * @returns `{ value }` (the parsed output) when valid, otherwise `{ issues }`.
431
+ */
432
+ validate: () => Promise<ValidationResult<SchemaOutput<TSchema>>>;
433
+ /**
434
+ * Validates the whole form against the schema but updates only the errors at `path`.
435
+ * @param path Dot-notation path.
436
+ * @returns `{ value }` (the current input value) when the field is valid, otherwise `{ issues }`
437
+ * for that field. A result made obsolete by a newer run is returned but not applied.
438
+ */
439
+ validateField: <TPath extends InputPath<TSchema>>(path: TPath) => Promise<ValidationResult<InputPathValue<TSchema, TPath>>>;
440
+ /** The live form data. Edit it directly, through `setValue`, or through field models. */
441
+ values: SchemaInput<TSchema>;
442
+ };
443
+ /**
444
+ * Props of the `<Form>` component.
445
+ * @template TSchema - The schema describing the form's data.
446
+ */
447
+ type FormProps<TSchema extends FormSchema> = {
448
+ /** The form returned by `useForm()`. */
449
+ form: UseFormInstance<TSchema>;
450
+ };
451
+ /** Slots of the `<Form>` component. */
452
+ type FormSlots = {
453
+ /** The form's contents (fields, buttons, ...). */
454
+ default?: () => void;
455
+ };
456
+ /**
457
+ * A subset of `FormInstance` that is safe to expose to consumers of `useForm()`.
458
+ * It omits internal methods that change the form's state, so they cannot be called from outside.
459
+ * @template TSchema - The schema describing the form's data.
460
+ */
461
+ type UseFormInstance<TSchema extends FormSchema> = Pick<FormInstance<TSchema>, 'arrayField' | 'errors' | 'field' | 'isDirty' | 'isSubmitted' | 'isSubmitting' | 'isTouched' | 'isValid' | 'isValidating' | 'reset' | 'resetCount' | 'setError' | 'setValue' | 'submit' | 'submitCount' | 'validate' | 'values'>;
462
+ export { InputPathValue as C, SchemaInput as D, FormSchema as E, SchemaOutput as O, InputPath as S, OutputPathValue as T, FieldValidationEvent as _, UseFormInstance as a, ArrayItem as b, ArrayFieldInstance as c, ArrayItemInstance as d, FieldConfig as f, FieldSlots as g, FieldProps as h, FormSlots as i, ArrayFieldProps as l, FieldInstance as m, FormInstance as n, FieldErrorProps as o, FieldEvents as p, FormProps as r, FieldErrorSlots as s, FormConfig as t, ArrayFieldSlots as u, ValidationIssue as v, OutputPath as w, InputArrayPath as x, ValidationResult as y };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @file
3
+ * Public/consumer types for the `notform` package
4
+ */
5
+ import { C as InputPathValue, D as SchemaInput, E as FormSchema, O as SchemaOutput, S as InputPath, T as OutputPathValue, _ as FieldValidationEvent, a as UseFormInstance, b as ArrayItem, c as ArrayFieldInstance, d as ArrayItemInstance, f as FieldConfig, g as FieldSlots, h as FieldProps, i as FormSlots, l as ArrayFieldProps, m as FieldInstance, n as FormInstance, o as FieldErrorProps, p as FieldEvents, r as FormProps, s as FieldErrorSlots, t as FormConfig, u as ArrayFieldSlots, v as ValidationIssue, w as OutputPath, x as InputArrayPath, y as ValidationResult } from "./types-1IibQKaB.js";
6
+ export type { ArrayFieldInstance, ArrayFieldProps, ArrayFieldSlots, ArrayItem, ArrayItemInstance, FieldConfig, FieldErrorProps, FieldErrorSlots, FieldEvents, FieldInstance, FieldProps, FieldSlots, FieldValidationEvent, FormConfig, FormInstance, FormProps, FormSchema, FormSlots, InputArrayPath, InputPath, InputPathValue, OutputPath, OutputPathValue, SchemaInput, SchemaOutput, UseFormInstance, ValidationIssue, ValidationResult };
package/dist/types.js ADDED
File without changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "notform",
3
3
  "type": "module",
4
- "version": "4.0.1",
4
+ "version": "4.1.0-alpha.0",
5
5
  "private": false,
6
6
  "description": "Vue forms without the friction",
7
7
  "author": "Favour Emeka <favorodera@gmail.com>",
@@ -27,6 +27,7 @@
27
27
  "sideEffects": false,
28
28
  "exports": {
29
29
  ".": "./dist/index.js",
30
+ "./types": "./dist/types.js",
30
31
  "./package.json": "./package.json"
31
32
  },
32
33
  "files": [
@@ -36,27 +37,27 @@
36
37
  "node": ">=24.0.0 <27.0.0"
37
38
  },
38
39
  "peerDependencies": {
39
- "vue": "^3.5.0"
40
+ "vue": "^3.5.45"
40
41
  },
41
42
  "dependencies": {
42
43
  "@standard-schema/spec": "^1.1.0",
43
44
  "dequal": "^2.0.3",
44
45
  "dot-prop": "^10.2.0",
45
46
  "klona": "^2.0.6",
46
- "type-fest": "^6.0.1"
47
+ "type-fest": "^6.0.3"
47
48
  },
48
49
  "devDependencies": {
49
- "@types/node": "^26.6.5",
50
- "@vitejs/plugin-vue": "^6.0.10",
51
- "@vitest/coverage-v8": "^5.1.0",
52
- "@vitest/ui": "^5.1.0",
53
- "@vue/test-utils": "^2.5.1",
50
+ "@types/node": "^26.6.6",
51
+ "@vitejs/plugin-vue": "^6.0.11",
52
+ "@vitest/coverage-v8": "^5.1.1",
53
+ "@vitest/ui": "^5.1.1",
54
+ "@vue/test-utils": "^2.6.0",
54
55
  "happy-dom": "^21.0.4",
55
56
  "tsdown": "^0.23.7",
56
- "vite": "^8.3.6",
57
- "vitest": "^5.1.0",
57
+ "vite": "^8.3.8",
58
+ "vitest": "^5.1.1",
58
59
  "vue": "^3.5.45",
59
- "vue-tsc": "^3.3.13"
60
+ "vue-tsc": "^3.3.14"
60
61
  },
61
62
  "scripts": {
62
63
  "build": "tsdown",