@koumoul/vjsf 3.7.0 → 3.7.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.7.0",
3
+ "version": "3.7.1",
4
4
  "description": "Generate forms for the vuetify UI library (vuejs) based on annotated JSON schemas.",
5
5
  "scripts": {
6
6
  "test": "vitest run",
@@ -71,7 +71,7 @@
71
71
  "vuetify": "^3.6.13"
72
72
  },
73
73
  "dependencies": {
74
- "@json-layout/core": "~1.4.0",
74
+ "@json-layout/core": "~1.4.1",
75
75
  "@vueuse/core": "^10.5.0",
76
76
  "debug": "^4.3.4"
77
77
  },
@@ -1,11 +1,14 @@
1
1
  <script setup>
2
- import { computed } from 'vue'
2
+ import Debug from 'debug'
3
+ import { computed, onRenderTriggered } from 'vue'
3
4
  import { useTheme, useDefaults } from 'vuetify'
4
5
  import { VCol } from 'vuetify/components/VGrid'
5
6
  import { VDefaultsProvider } from 'vuetify/components/VDefaultsProvider'
6
7
  import NodeSlot from './fragments/node-slot.vue'
7
8
  import HelpMessage from './fragments/help-message.vue'
8
9
 
10
+ const debugRender = Debug('vjsf:render')
11
+
9
12
  useDefaults({}, 'VjsfNode')
10
13
 
11
14
  const props = defineProps({
@@ -30,6 +33,13 @@ const beforeAfterClasses = {
30
33
 
31
34
  const theme = useTheme()
32
35
 
36
+ if (debugRender.enabled) {
37
+ debugRender('setup node', props.modelValue.fullKey, props.modelValue.layout.comp)
38
+ onRenderTriggered(() => {
39
+ debugRender('render node', props.modelValue.fullKey, props.modelValue.layout.comp)
40
+ })
41
+ }
42
+
33
43
  const indent = computed(() => {
34
44
  if (props.modelValue.parentFullKey === null) return 0
35
45
  if (!props.modelValue.options.indent) return 0
@@ -24,15 +24,15 @@ export default defineComponent({
24
24
  const textarea = ref(null)
25
25
 
26
26
  const { inputProps, localData, compSlots, options } = useNode(
27
- toRef(props, 'modelValue'), props.statefulLayout, { layoutPropsMap: ['placeholder'] }
27
+ toRef(props, 'modelValue'), props.statefulLayout, { layoutPropsMap: ['placeholder', 'rows'] }
28
28
  )
29
29
 
30
- const rows = computed(() => options.value.readOnly && options.value.summary ? 3 : undefined)
30
+ const defaultRows = computed(() => options.value.readOnly && options.value.summary ? 3 : undefined)
31
31
 
32
32
  const fullProps = computed(() => {
33
33
  const fullProps = { ...inputProps.value }
34
34
  fullProps.ref = textarea
35
- fullProps.rows = rows.value
35
+ fullProps.rows = fullProps.rows ?? defaultRows.value
36
36
  fullProps.modelValue = localData.value
37
37
  return fullProps
38
38
  })
@@ -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>;
@@ -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;
@@ -25,7 +25,7 @@ export default function _default(nodeRef: import('vue').Ref<import('../types.js'
25
25
  compSlots: import("vue").ComputedRef<Record<string, any>>;
26
26
  options: import("vue").ComputedRef<Required<import("../types.js").VjsfOptions>>;
27
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>;
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
30
  children: import("vue").ComputedRef<import("../../node_modules/@json-layout/core/types/state/types.js").StateNode[] | undefined>;
31
31
  };
@@ -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;