@koumoul/vjsf 3.4.0 → 3.5.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koumoul/vjsf",
3
- "version": "3.4.0",
3
+ "version": "3.5.1",
4
4
  "description": "Generate forms for the vuetify UI library (vuejs) based on annotated JSON schemas.",
5
5
  "scripts": {
6
6
  "test": "vitest",
@@ -70,7 +70,7 @@
70
70
  "vuetify": "^3.6.13"
71
71
  },
72
72
  "dependencies": {
73
- "@json-layout/core": "~1.1.0",
73
+ "@json-layout/core": "~1.2.2",
74
74
  "@vueuse/core": "^10.5.0",
75
75
  "debug": "^4.3.4"
76
76
  },
@@ -79,6 +79,7 @@ export default function (nodeRef, statefulLayout, opts = {}) {
79
79
  const fullProps = mergePropsLevels(propsLevels)
80
80
 
81
81
  fullProps.label = layout.value.label
82
+ fullProps.hint = layout.value.hint
82
83
  if (error.value && validated.value) {
83
84
  fullProps.errorMessages = error.value
84
85
  }
@@ -1,6 +1,6 @@
1
1
  import { useDefaults, useLocale } from 'vuetify'
2
2
  import { StatefulLayout, produceCompileOptions } from '@json-layout/core'
3
- import { inject, toRaw, shallowRef, computed, ref, watch, useSlots, getCurrentInstance } from 'vue'
3
+ import { inject, toRaw, shallowRef, computed, ref, watch, useSlots, getCurrentInstance, nextTick } from 'vue'
4
4
  import { useElementSize } from '@vueuse/core'
5
5
  import { getFullOptions } from '../options.js'
6
6
  import { setAutoFreeze } from 'immer'
@@ -88,9 +88,10 @@ export const useVjsf = (schema, modelValue, options, nodeComponents, emit, compi
88
88
  /**
89
89
  * @param {any} data
90
90
  */
91
- const onDataUpdate = (data) => {
91
+ const onDataUpdate = async (data) => {
92
92
  debug('onDataUpdate', data)
93
93
  debug(' -> emit update:modelValue')
94
+ await nextTick() // necessary for form validation to be applied before emitting new data
94
95
  emit('update:modelValue', data)
95
96
  }
96
97
  const onAutofocus = () => {
@@ -1,7 +1,7 @@
1
1
  declare const _default: import("vue").DefineComponent<any, {
2
- modelValue: import("../../../node_modules/@json-layout/core/types/state/types.js").StateNode;
2
+ modelValue: import("../../../../node_modules/@json-layout/core/types/state/types.js").StateNode;
3
3
  $props: {
4
- modelValue?: import("../../../node_modules/@json-layout/core/types/state/types.js").StateNode | undefined;
4
+ modelValue?: import("../../../../node_modules/@json-layout/core/types/state/types.js").StateNode | undefined;
5
5
  };
6
6
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<any> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
7
7
  export default _default;
@@ -1,10 +1,10 @@
1
1
  declare const _default: import("vue").DefineComponent<any, {
2
2
  multiple: boolean;
3
- item: import("../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItem;
3
+ item: import("../../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItem;
4
4
  itemProps: Record<string, any>;
5
5
  $props: {
6
6
  readonly multiple?: boolean | undefined;
7
- readonly item?: import("../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItem | undefined;
7
+ readonly item?: import("../../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItem | undefined;
8
8
  readonly itemProps?: Record<string, any> | undefined;
9
9
  };
10
10
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<any> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,10 +1,10 @@
1
1
  declare const _default: import("vue").DefineComponent<any, {
2
2
  multiple: boolean;
3
- item: import("../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItem;
3
+ item: import("../../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItem;
4
4
  last: boolean;
5
5
  $props: {
6
6
  readonly multiple?: boolean | undefined;
7
- readonly item?: import("../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItem | undefined;
7
+ readonly item?: import("../../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItem | undefined;
8
8
  readonly last?: boolean | undefined;
9
9
  };
10
10
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<any> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,8 +1,8 @@
1
1
  declare const _default: import("vue").DefineComponent<any, {
2
- modelValue: import("../../node_modules/@json-layout/core/types/state/types.js").StateTree;
2
+ modelValue: import("../../../node_modules/@json-layout/core/types/state/types.js").StateTree;
3
3
  statefulLayout: import("../types.js").VjsfStatefulLayout;
4
4
  $props: {
5
- readonly modelValue?: import("../../node_modules/@json-layout/core/types/state/types.js").StateTree | undefined;
5
+ readonly modelValue?: import("../../../node_modules/@json-layout/core/types/state/types.js").StateTree | undefined;
6
6
  readonly statefulLayout?: import("../types.js").VjsfStatefulLayout | undefined;
7
7
  };
8
8
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<any> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -3,12 +3,12 @@ declare const _default: import("vue").DefineComponent<any, {
3
3
  options: Partial<Omit<import("../types.js").VjsfOptions, "onData" | "onUpdate" | "onAutofocus" | "width" | "vjsfSlots">> | null;
4
4
  modelValue: any;
5
5
  schema: Record<string, any>;
6
- precompiledLayout: import("../../node_modules/@json-layout/core/types/compile/types.js").CompiledLayout;
6
+ precompiledLayout: import("../../../node_modules/@json-layout/core/types/compile/types.js").CompiledLayout;
7
7
  $props: {
8
8
  readonly options?: Partial<Omit<import("../types.js").VjsfOptions, "onData" | "onUpdate" | "onAutofocus" | "width" | "vjsfSlots">> | null | undefined;
9
9
  readonly modelValue?: any;
10
10
  readonly schema?: Record<string, any> | undefined;
11
- readonly precompiledLayout?: import("../../node_modules/@json-layout/core/types/compile/types.js").CompiledLayout | undefined;
11
+ readonly precompiledLayout?: import("../../../node_modules/@json-layout/core/types/compile/types.js").CompiledLayout | undefined;
12
12
  };
13
13
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<any> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
14
14
  export default _default;
@@ -4,7 +4,7 @@
4
4
  */
5
5
  export default function _default(nodeRef: import('vue').Ref<import('../types.js').VjsfNode>, statefulLayout: import('../types.js').VjsfStatefulLayout): {
6
6
  hasItems: import("vue").ComputedRef<boolean>;
7
- items: import("vue").Ref<import("../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItems, import("../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItems>;
7
+ items: import("vue").Ref<import("../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItems, import("../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItems>;
8
8
  loading: import("vue").Ref<boolean, boolean>;
9
9
  search: import("vue").Ref<string, string>;
10
10
  prepareSelectedItem: (selectedItem: any, itemValue: any) => any;
@@ -24,9 +24,9 @@ export default function _default(nodeRef: import('vue').Ref<import('../types.js'
24
24
  }>;
25
25
  compSlots: import("vue").ComputedRef<Record<string, any>>;
26
26
  options: import("vue").ComputedRef<Required<import("../types.js").VjsfOptions>>;
27
- skeleton: import("vue").ComputedRef<import("../../node_modules/@json-layout/core/types/compile/types.js").SkeletonNode>;
28
- layout: import("vue").ComputedRef<import("../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").BaseCompObject>;
27
+ skeleton: import("vue").ComputedRef<import("../../../node_modules/@json-layout/core/types/compile/types.js").SkeletonNode>;
28
+ layout: import("vue").ComputedRef<import("../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").BaseCompObject>;
29
29
  data: import("vue").ComputedRef<unknown>;
30
- children: import("vue").ComputedRef<import("../../node_modules/@json-layout/core/types/state/types.js").StateNode[] | undefined>;
30
+ children: import("vue").ComputedRef<import("../../../node_modules/@json-layout/core/types/state/types.js").StateNode[] | undefined>;
31
31
  };
32
32
  //# sourceMappingURL=use-node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-node.d.ts","sourceRoot":"","sources":["../../src/composables/use-node.js"],"names":[],"mappings":"AAcA;;;GAGG;AACH,8CAHW,CAAC,OAAO,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC,EAAE,GACjC,OAAO,MAAM,EAAE,GAAG,CAAC,GAAG;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAC,CAqBnD;AAED;;;;GAIG;AACH,0CAJW,OAAO,KAAK,EAAE,GAAG,CAAC,OAAO,aAAa,EAAE,QAAQ,CAAC,kBACjD,OAAO,aAAa,EAAE,kBAAkB;;;;;;;eAzBR,MAAM,EAAE;;;eAAR,MAAM,EAAE;;;;;;;;EAuHlD"}
1
+ {"version":3,"file":"use-node.d.ts","sourceRoot":"","sources":["../../src/composables/use-node.js"],"names":[],"mappings":"AAcA;;;GAGG;AACH,8CAHW,CAAC,OAAO,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC,EAAE,GACjC,OAAO,MAAM,EAAE,GAAG,CAAC,GAAG;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAC,CAqBnD;AAED;;;;GAIG;AACH,0CAJW,OAAO,KAAK,EAAE,GAAG,CAAC,OAAO,aAAa,EAAE,QAAQ,CAAC,kBACjD,OAAO,aAAa,EAAE,kBAAkB;;;;;;;eAzBR,MAAM,EAAE;;;eAAR,MAAM,EAAE;;;;;;;;EAwHlD"}
@@ -18,7 +18,7 @@ export default function _default(nodeRef: import('vue').Ref<import('../types.js'
18
18
  }>;
19
19
  getItems: {
20
20
  hasItems: import("vue").ComputedRef<boolean>;
21
- items: import("vue").Ref<import("../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItems, import("../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItems>;
21
+ items: import("vue").Ref<import("../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItems, import("../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItems>;
22
22
  loading: import("vue").Ref<boolean, boolean>;
23
23
  search: import("vue").Ref<string, string>;
24
24
  prepareSelectedItem: (selectedItem: any, itemValue: any) => any;
@@ -8,9 +8,9 @@ export const emits: {
8
8
  */
9
9
  'update:state': (state: import('../types.js').VjsfStatefulLayout) => boolean;
10
10
  };
11
- export function useVjsf(schema: import('vue').Ref<Object>, modelValue: import('vue').Ref<any>, options: import('vue').Ref<import("../types.js").PartialVjsfOptions | null>, nodeComponents: Record<string, import('vue').Component>, emit: any, compile?: typeof import("@json-layout/core").compile | undefined, precompiledLayout?: import("vue").Ref<import("../../node_modules/@json-layout/core/types/compile/types.js").CompiledLayout, import("../../node_modules/@json-layout/core/types/compile/types.js").CompiledLayout> | undefined): {
11
+ export function useVjsf(schema: import('vue').Ref<Object>, modelValue: import('vue').Ref<any>, options: import('vue').Ref<import("../types.js").PartialVjsfOptions | null>, nodeComponents: Record<string, import('vue').Component>, emit: any, compile?: typeof import("@json-layout/core").compile | undefined, precompiledLayout?: import("vue").Ref<import("../../../node_modules/@json-layout/core/types/compile/types.js").CompiledLayout, import("../../../node_modules/@json-layout/core/types/compile/types.js").CompiledLayout> | undefined): {
12
12
  el: import("vue").Ref<null, null>;
13
13
  statefulLayout: import("vue").ShallowRef<import("../types.js").VjsfStatefulLayout | null>;
14
- stateTree: import("vue").ShallowRef<import("../../node_modules/@json-layout/core/types/state/types.js").StateTree | null>;
14
+ stateTree: import("vue").ShallowRef<import("../../../node_modules/@json-layout/core/types/state/types.js").StateTree | null>;
15
15
  };
16
16
  //# sourceMappingURL=use-vjsf.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-vjsf.d.ts","sourceRoot":"","sources":["../../src/composables/use-vjsf.js"],"names":[],"mappings":"AAaA;IACE;;MAEE;gCADO,GAAG;IAGZ;;MAEE;4BADO,OAAO,aAAa,EAAE,kBAAkB;EAGlD;AAWM,gCARI,OAAO,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,cACzB,OAAO,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,WACtB,OAAO,KAAK,EAAE,GAAG,CAAC,OAAO,aAAa,EAAE,kBAAkB,GAAG,IAAI,CAAC,kBAClE,OAAO,MAAM,EAAE,OAAO,KAAK,EAAE,SAAS,CAAC,QACvC,GAAG;;;;EA6Ib"}
1
+ {"version":3,"file":"use-vjsf.d.ts","sourceRoot":"","sources":["../../src/composables/use-vjsf.js"],"names":[],"mappings":"AAaA;IACE;;MAEE;gCADO,GAAG;IAGZ;;MAEE;4BADO,OAAO,aAAa,EAAE,kBAAkB;EAGlD;AAWM,gCARI,OAAO,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,cACzB,OAAO,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,WACtB,OAAO,KAAK,EAAE,GAAG,CAAC,OAAO,aAAa,EAAE,kBAAkB,GAAG,IAAI,CAAC,kBAClE,OAAO,MAAM,EAAE,OAAO,KAAK,EAAE,SAAS,CAAC,QACvC,GAAG;;;;EA8Ib"}