notform 1.0.4 → 1.0.6
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 +12 -8
- package/dist/index.js +3 -1
- package/package.json +2 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vue6 from "vue";
|
|
2
2
|
import { ComputedRef, MaybeRefOrGetter, Ref, VNodeChild, useAttrs } from "vue";
|
|
3
3
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
4
4
|
import { PartialDeep, Paths as Paths$1 } from "type-fest";
|
|
@@ -286,14 +286,14 @@ type NotMessageSlots = {
|
|
|
286
286
|
//#endregion
|
|
287
287
|
//#region src/components/not-form.vue.d.ts
|
|
288
288
|
declare const __VLS_export$3: <TSchema extends ObjectSchema>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal$2<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
289
|
-
props:
|
|
289
|
+
props: vue6.PublicProps & __VLS_PrettifyLocal$2<NotFormProps<TSchema>> & (typeof globalThis extends {
|
|
290
290
|
__VLS_PROPS_FALLBACK: infer P;
|
|
291
291
|
} ? P : {});
|
|
292
292
|
expose: (exposed: {}) => void;
|
|
293
293
|
attrs: any;
|
|
294
294
|
slots: NotFormSlots<TSchema>;
|
|
295
295
|
emit: {};
|
|
296
|
-
}>) =>
|
|
296
|
+
}>) => vue6.VNode & {
|
|
297
297
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
298
298
|
};
|
|
299
299
|
declare const _default$2: typeof __VLS_export$3;
|
|
@@ -304,7 +304,7 @@ type __VLS_PrettifyLocal$2<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K
|
|
|
304
304
|
* Slots provided by the NotField component.
|
|
305
305
|
*/
|
|
306
306
|
type __VLS_Slots = NotFieldSlots;
|
|
307
|
-
declare const __VLS_base:
|
|
307
|
+
declare const __VLS_base: vue6.DefineComponent<NotFieldProps, {}, {}, {}, {}, vue6.ComponentOptionsMixin, vue6.ComponentOptionsMixin, {}, string, vue6.PublicProps, Readonly<NotFieldProps> & Readonly<{}>, {}, {}, {}, {}, string, vue6.ComponentProvideOptions, false, {}, any>;
|
|
308
308
|
declare const __VLS_export$2: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
309
309
|
declare const _default$1: typeof __VLS_export$2;
|
|
310
310
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -315,14 +315,14 @@ type __VLS_WithSlots<T, S> = T & {
|
|
|
315
315
|
//#endregion
|
|
316
316
|
//#region src/components/not-message.vue.d.ts
|
|
317
317
|
declare const __VLS_export$1: <TSchema extends ObjectSchema>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal$1<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
318
|
-
props:
|
|
318
|
+
props: vue6.PublicProps & __VLS_PrettifyLocal$1<NotMessageProps> & (typeof globalThis extends {
|
|
319
319
|
__VLS_PROPS_FALLBACK: infer P;
|
|
320
320
|
} ? P : {});
|
|
321
321
|
expose: (exposed: {}) => void;
|
|
322
322
|
attrs: any;
|
|
323
323
|
slots: NotMessageSlots;
|
|
324
324
|
emit: {};
|
|
325
|
-
}>) =>
|
|
325
|
+
}>) => vue6.VNode & {
|
|
326
326
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
327
327
|
};
|
|
328
328
|
declare const _default$3: typeof __VLS_export$1;
|
|
@@ -344,6 +344,10 @@ type NotArrayFieldProps<TSchema extends ArraySchema> = {
|
|
|
344
344
|
* @template TSchema The schema of the array field.
|
|
345
345
|
*/
|
|
346
346
|
type NotArrayFieldContext<TSchema extends ArraySchema> = {
|
|
347
|
+
/** The unique name/path identifying the array field in the form state */
|
|
348
|
+
name: string;
|
|
349
|
+
/** Array-level validation errors for the field path */
|
|
350
|
+
errors: string[];
|
|
347
351
|
/**
|
|
348
352
|
* Array of individual field contexts for each item in the collection.
|
|
349
353
|
* Useful for mapping components to array elements.
|
|
@@ -393,14 +397,14 @@ type NotArrayFieldSlots<TSchema extends ArraySchema> = {
|
|
|
393
397
|
//#endregion
|
|
394
398
|
//#region src/components/not-array-field.vue.d.ts
|
|
395
399
|
declare const __VLS_export: <TArraySchema extends ArraySchema, TObjectSchema extends ObjectSchema = ObjectSchema>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
396
|
-
props:
|
|
400
|
+
props: vue6.PublicProps & __VLS_PrettifyLocal<NotArrayFieldProps<TArraySchema>> & (typeof globalThis extends {
|
|
397
401
|
__VLS_PROPS_FALLBACK: infer P;
|
|
398
402
|
} ? P : {});
|
|
399
403
|
expose: (exposed: {}) => void;
|
|
400
404
|
attrs: any;
|
|
401
405
|
slots: NotArrayFieldSlots<TArraySchema>;
|
|
402
406
|
emit: {};
|
|
403
|
-
}>) =>
|
|
407
|
+
}>) => vue6.VNode & {
|
|
404
408
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
405
409
|
};
|
|
406
410
|
declare const _default: typeof __VLS_export;
|
package/dist/index.js
CHANGED
|
@@ -235,7 +235,7 @@ var not_array_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
|
|
|
235
235
|
*/
|
|
236
236
|
const formID = inject(CURRENT_NOT_FORM_ID_KEY);
|
|
237
237
|
if (!formID) throw new Error("NotArrayField must be used inside a NotForm component");
|
|
238
|
-
const { state, validateField } = withContext(formID);
|
|
238
|
+
const { state, validateField, getFieldErrors } = withContext(formID);
|
|
239
239
|
/**
|
|
240
240
|
* Reactive bridge between the form state and the specific array field.
|
|
241
241
|
*/
|
|
@@ -310,6 +310,8 @@ var not_array_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
|
|
|
310
310
|
* Reactive context object exposed to the NotArrayField slot.
|
|
311
311
|
*/
|
|
312
312
|
const context = reactive({
|
|
313
|
+
name: computed(() => props.name),
|
|
314
|
+
errors: computed(() => getFieldErrors(props.name).map((error) => error.message)),
|
|
313
315
|
fields,
|
|
314
316
|
append,
|
|
315
317
|
prepend,
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "notform",
|
|
3
|
+
"version": "1.0.6",
|
|
3
4
|
"type": "module",
|
|
4
5
|
"private": false,
|
|
5
6
|
"publishConfig": {
|
|
6
7
|
"access": "public"
|
|
7
8
|
},
|
|
8
|
-
"version": "1.0.4",
|
|
9
9
|
"description": "Vue Forms Without the Friction",
|
|
10
10
|
"author": "Favour Emeka <favorodera@gmail.com>",
|
|
11
11
|
"license": "MIT",
|
|
@@ -51,8 +51,7 @@
|
|
|
51
51
|
"vitest": "^4.0.16",
|
|
52
52
|
"vitest-browser-vue": "^2.0.1",
|
|
53
53
|
"vue": "^3.5.25",
|
|
54
|
-
"vue-tsc": "^3.2.2"
|
|
55
|
-
"yup": "^1.7.1"
|
|
54
|
+
"vue-tsc": "^3.2.2"
|
|
56
55
|
},
|
|
57
56
|
"dependencies": {
|
|
58
57
|
"@standard-schema/spec": "^1.1.0",
|