notform 1.0.5 → 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 CHANGED
@@ -1,4 +1,4 @@
1
- import * as vue0 from "vue";
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: vue0.PublicProps & __VLS_PrettifyLocal$2<NotFormProps<TSchema>> & (typeof globalThis extends {
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
- }>) => vue0.VNode & {
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: vue0.DefineComponent<NotFieldProps, {}, {}, {}, {}, vue0.ComponentOptionsMixin, vue0.ComponentOptionsMixin, {}, string, vue0.PublicProps, Readonly<NotFieldProps> & Readonly<{}>, {}, {}, {}, {}, string, vue0.ComponentProvideOptions, false, {}, any>;
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: vue0.PublicProps & __VLS_PrettifyLocal$1<NotMessageProps> & (typeof globalThis extends {
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
- }>) => vue0.VNode & {
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: vue0.PublicProps & __VLS_PrettifyLocal<NotArrayFieldProps<TArraySchema>> & (typeof globalThis extends {
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
- }>) => vue0.VNode & {
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,6 +1,6 @@
1
1
  {
2
2
  "name": "notform",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "publishConfig": {