@koumoul/vjsf 3.5.1 → 3.6.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,9 +1,10 @@
1
1
  {
2
2
  "name": "@koumoul/vjsf",
3
- "version": "3.5.1",
3
+ "version": "3.6.1",
4
4
  "description": "Generate forms for the vuetify UI library (vuejs) based on annotated JSON schemas.",
5
5
  "scripts": {
6
- "test": "vitest",
6
+ "test": "vitest run",
7
+ "test-watch": "vitest",
7
8
  "build": "vue-tsc",
8
9
  "watch:build": "vue-tsc --watch",
9
10
  "prepublishOnly": "npm run build && cp ../README.md README.md && cp ../LICENSE LICENSE"
@@ -70,7 +71,7 @@
70
71
  "vuetify": "^3.6.13"
71
72
  },
72
73
  "dependencies": {
73
- "@json-layout/core": "~1.2.2",
74
+ "@json-layout/core": "~1.3.0",
74
75
  "@vueuse/core": "^10.5.0",
75
76
  "debug": "^4.3.4"
76
77
  },
@@ -50,7 +50,7 @@ const nodeClasses = computed(() => {
50
50
  return classes
51
51
  })
52
52
 
53
- if (props.modelValue.layout.comp !== 'none' && !props.statefulLayout.options.nodeComponents[props.modelValue.layout.comp]) {
53
+ if (props.modelValue.layout.comp !== 'none' && !props.modelValue.slots?.component && !props.statefulLayout.options.nodeComponents[props.modelValue.layout.comp]) {
54
54
  console.error(`vjsf: missing component to render vjsf node "${props.modelValue.layout.comp}", maybe you forgot to register a component from a plugin ?`)
55
55
  }
56
56
 
@@ -64,9 +64,9 @@ if (props.modelValue.layout.comp !== 'none' && !props.statefulLayout.options.nod
64
64
  :class="nodeClasses"
65
65
  >
66
66
  <node-slot
67
- v-if="modelValue.layout.slots?.before"
67
+ v-if="modelValue.slots?.before"
68
68
  key="before"
69
- :layout-slot="modelValue.layout.slots?.before"
69
+ :layout-slot="modelValue.slots?.before"
70
70
  :node="modelValue"
71
71
  :stateful-layout="statefulLayout"
72
72
  :class="beforeAfterClasses[modelValue.options.density]"
@@ -77,9 +77,9 @@ if (props.modelValue.layout.comp !== 'none' && !props.statefulLayout.options.nod
77
77
  :node="modelValue"
78
78
  />
79
79
  <node-slot
80
- v-if="modelValue.layout.slots?.component"
80
+ v-if="modelValue.slots?.component"
81
81
  key="component"
82
- :layout-slot="modelValue.layout.slots?.component"
82
+ :layout-slot="modelValue.slots?.component"
83
83
  :node="modelValue"
84
84
  :stateful-layout="statefulLayout"
85
85
  />
@@ -91,9 +91,9 @@ if (props.modelValue.layout.comp !== 'none' && !props.statefulLayout.options.nod
91
91
  />
92
92
 
93
93
  <node-slot
94
- v-if="modelValue.layout.slots?.after"
94
+ v-if="modelValue.slots?.after"
95
95
  key="after"
96
- :layout-slot="modelValue.layout.slots?.after"
96
+ :layout-slot="modelValue.slots?.after"
97
97
  :node="modelValue"
98
98
  :stateful-layout="statefulLayout"
99
99
  :class="beforeAfterClasses[modelValue.options.density]"
@@ -25,7 +25,10 @@ defineProps({
25
25
  <template>
26
26
  <v-card :title="modelValue.layout.title ?? ''">
27
27
  <v-container fluid>
28
- <section-header :node="modelValue" hide-title />
28
+ <section-header
29
+ :node="modelValue"
30
+ hide-title
31
+ />
29
32
  <v-row :dense="modelValue.options?.density === 'compact' || modelValue.options?.density === 'comfortable'">
30
33
  <node
31
34
  v-for="child of modelValue.children"
@@ -47,6 +47,10 @@ const onChange = (/** @type {string} */childTree) => {
47
47
  const fieldProps = computed(() => {
48
48
  const fieldProps = { ...inputProps.value }
49
49
  fieldProps['onUpdate:modelValue'] = onChange
50
+ if (!props.modelValue.options.readOnly) {
51
+ // vuetify zIndex stacking is buggy (for example https://github.com/vuetifyjs/vuetify/issues/16251)
52
+ fieldProps.menuProps = { zIndex: 3000 }
53
+ }
50
54
  const items = []
51
55
  for (const childTreePointer of skeleton.value.childrenTrees || []) {
52
56
  const childTree = props.statefulLayout.compiledLayout.skeletonTrees[childTreePointer]
@@ -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
@@ -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