@koumoul/vjsf 3.0.0-beta.1 → 3.0.0-beta.11

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.
Files changed (51) hide show
  1. package/package.json +18 -18
  2. package/src/compat/v2.js +6 -0
  3. package/src/compile/index.js +18 -4
  4. package/src/compile/options.js +3 -7
  5. package/src/compile/v-jsf-compiled.vue.ejs +1 -1
  6. package/src/components/fragments/section-header.vue +1 -2
  7. package/src/components/fragments/text-field-menu.vue +1 -1
  8. package/src/components/node.vue +1 -1
  9. package/src/components/nodes/checkbox.vue +6 -1
  10. package/src/components/nodes/color-picker.vue +2 -1
  11. package/src/components/nodes/date-picker.vue +1 -1
  12. package/src/components/nodes/expansion-panels.vue +22 -12
  13. package/src/components/nodes/list.vue +7 -1
  14. package/src/components/nodes/switch.vue +6 -3
  15. package/src/components/options.js +15 -5
  16. package/src/composables/use-vjsf.js +32 -9
  17. package/src/types.ts +15 -6
  18. package/src/utils/build.js +1 -1
  19. package/src/utils/index.js +0 -1
  20. package/src/utils/props.js +9 -25
  21. package/types/compat/v2.d.ts.map +1 -1
  22. package/types/compile/index.d.ts +2 -2
  23. package/types/compile/index.d.ts.map +1 -1
  24. package/types/compile/options.d.ts.map +1 -1
  25. package/types/components/fragments/select-item.vue.d.ts +2 -2
  26. package/types/components/fragments/select-selection.vue.d.ts +2 -2
  27. package/types/components/options.d.ts +2 -2
  28. package/types/components/options.d.ts.map +1 -1
  29. package/types/components/tree.vue.d.ts +2 -2
  30. package/types/components/vjsf.vue.d.ts +6 -6
  31. package/types/composables/use-vjsf.d.ts +2 -2
  32. package/types/composables/use-vjsf.d.ts.map +1 -1
  33. package/types/types.d.ts +11 -23
  34. package/types/types.d.ts.map +1 -1
  35. package/types/utils/build.d.ts +1 -1
  36. package/types/utils/index.d.ts +0 -1
  37. package/types/utils/props.d.ts +3 -4
  38. package/types/utils/props.d.ts.map +1 -1
  39. package/src/utils/global-register.js +0 -13
  40. package/types/components/global-register.d.ts +0 -8
  41. package/types/components/global-register.d.ts.map +0 -1
  42. package/types/components/nodes/markdown.vue.d.ts +0 -27
  43. package/types/components/nodes/markdown.vue.d.ts.map +0 -1
  44. package/types/components/nodes/text-field copy.vue.d.ts +0 -10
  45. package/types/components/nodes/text-field copy.vue.d.ts.map +0 -1
  46. package/types/components/types.d.ts +0 -91
  47. package/types/components/types.d.ts.map +0 -1
  48. package/types/components/v-jsf.vue.d.ts +0 -13
  49. package/types/components/v-jsf.vue.d.ts.map +0 -1
  50. package/types/utils/clone.d.ts +0 -3
  51. package/types/utils/clone.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koumoul/vjsf",
3
- "version": "3.0.0-beta.1",
3
+ "version": "3.0.0-beta.11",
4
4
  "description": "Generate forms for the vuetify UI library (vuejs) based on annotated JSON schemas.",
5
5
  "scripts": {
6
6
  "test": "vitest",
@@ -18,38 +18,38 @@
18
18
  "exports": {
19
19
  ".": {
20
20
  "import": {
21
- "default": "./src/index.js",
22
- "types": "./types/index.d.ts"
21
+ "types": "./types/index.d.ts",
22
+ "default": "./src/index.js"
23
23
  }
24
24
  },
25
25
  "./types.js": {
26
26
  "import": {
27
- "default": "./src/types.js",
28
- "types": "./types/types.d.ts"
27
+ "types": "./types/types.d.ts",
28
+ "default": "./src/types.js"
29
29
  }
30
30
  },
31
31
  "./components/*": {
32
32
  "import": {
33
- "default": "./src/components/*",
34
- "types": "./types/components/*.d.ts"
33
+ "types": "./types/components/*.d.ts",
34
+ "default": "./src/components/*"
35
35
  }
36
36
  },
37
37
  "./composables/*": {
38
38
  "import": {
39
- "default": "./src/composables/*",
40
- "types": "./types/composables/*.d.ts"
39
+ "types": "./types/composables/*.d.ts",
40
+ "default": "./src/composables/*"
41
41
  }
42
42
  },
43
43
  "./utils": {
44
44
  "import": {
45
- "default": "./src/utils/index.js",
46
- "types": "./types/utils/index.d.ts"
45
+ "types": "./types/utils/index.d.ts",
46
+ "default": "./src/utils/index.js"
47
47
  }
48
48
  },
49
49
  "./utils/*": {
50
50
  "import": {
51
- "default": "./src/utils/*",
52
- "types": "./types/utils/*.d.ts"
51
+ "types": "./types/utils/*.d.ts",
52
+ "default": "./src/utils/*"
53
53
  }
54
54
  },
55
55
  "./styles/*": {
@@ -59,14 +59,14 @@
59
59
  },
60
60
  "./compile": {
61
61
  "import": {
62
- "default": "./src/compile/index.js",
63
- "types": "./types/compile/index.d.ts"
62
+ "types": "./types/compile/index.d.ts",
63
+ "default": "./src/compile/index.js"
64
64
  }
65
65
  },
66
66
  "./compat/v2": {
67
67
  "import": {
68
- "default": "./src/compat/v2.js",
69
- "types": "./types/compat/v2.d.ts"
68
+ "types": "./types/compat/v2.d.ts",
69
+ "default": "./src/compat/v2.js"
70
70
  }
71
71
  }
72
72
  },
@@ -75,7 +75,7 @@
75
75
  "vuetify": "^3.4.9"
76
76
  },
77
77
  "dependencies": {
78
- "@json-layout/core": "0.9.1",
78
+ "@json-layout/core": "0.15.1",
79
79
  "@vueuse/core": "^10.5.0",
80
80
  "debug": "^4.3.4",
81
81
  "ejs": "^3.1.9"
package/src/compat/v2.js CHANGED
@@ -11,6 +11,12 @@ const processFragment = (/** @type {import("ajv").SchemaObject} */schema) => {
11
11
  /** @type import('@json-layout/vocabulary').PartialCompObject */
12
12
  const layout = {}
13
13
 
14
+ if (schema.separator || schema['x-separator']) {
15
+ layout.separator = schema.separator || schema['x-separator']
16
+ delete schema.separator
17
+ delete schema['x-separator']
18
+ }
19
+
14
20
  if (schema['x-display'] === 'icon' && (schema.enum || schema.items?.enum)) {
15
21
  layout.getItems = { itemIcon: schema['x-itemIcon'] || 'data.value' }
16
22
  delete schema['x-display']
@@ -37,10 +37,17 @@ function listComps (comps, layout) {
37
37
  * @param {object} schema
38
38
  * @param {import('../types.js').PartialVjsfCompileOptions} [options]
39
39
  * @param {string} [baseImport]
40
- * @returns {string}
40
+ * @returns {Promise<string>}
41
41
  */
42
- export function compile (schema, options = {}, baseImport = '@koumoul/vjsf') {
42
+ export async function compile (schema, options = {}, baseImport = '@koumoul/vjsf') {
43
43
  const fullOptions = getFullOptions(options)
44
+ /** @type {Record<string, string>} */
45
+ const pluginsImportsByName = {}
46
+ for (const pluginImport of fullOptions.pluginsImports) {
47
+ const componentInfo = /** @type {import('@json-layout/vocabulary').ComponentInfo} */((await import(pluginImport + '/info.js')).default)
48
+ fullOptions.components[componentInfo.name] = componentInfo
49
+ pluginsImportsByName[componentInfo.name] = pluginImport
50
+ }
44
51
  const compiledLayout = compileLayout(schema, { ...fullOptions, code: true })
45
52
  const compiledLayoutCode = serializeCompiledLayout(compiledLayout)
46
53
  /** @type Set<string> */
@@ -50,9 +57,16 @@ export function compile (schema, options = {}, baseImport = '@koumoul/vjsf') {
50
57
  }
51
58
  comps.delete('none')
52
59
 
60
+ /** @type {Record<string, any>} */
61
+ const pluginsComponents = {}
62
+
53
63
  const compImports = [...comps].map(comp => {
54
64
  const compName = comp.replace(/-/g, '') + 'Node'
55
- const compImport = fullOptions.nodeComponentImports[comp] ?? `${baseImport}/components/nodes/${comp}.vue`
65
+ let compImport = `${baseImport}/components/nodes/${comp}.vue`
66
+ if (pluginsImportsByName[comp]) {
67
+ compImport = `${pluginsImportsByName[comp]}/node.vue`
68
+ pluginsComponents[comp] = fullOptions.components[comp]
69
+ }
56
70
  return {
57
71
  comp,
58
72
  compName,
@@ -60,6 +74,6 @@ export function compile (schema, options = {}, baseImport = '@koumoul/vjsf') {
60
74
  }
61
75
  })
62
76
 
63
- const code = ejs.render(template, { compiledLayoutCode, compImports, baseImport })
77
+ const code = ejs.render(template, { compiledLayoutCode, compImports, baseImport, pluginsComponents })
64
78
  return code
65
79
  }
@@ -1,8 +1,7 @@
1
1
  /** @type import("../types.js").PartialVjsfCompileOptions */
2
2
  export const defaultOptions = {
3
- nodeComponentImports: {
4
- markdown: '@koumoul/vjsf-markdown/components/nodes/markdown.vue'
5
- }
3
+ pluginsImports: ['@koumoul/vjsf-markdown'],
4
+ components: {}
6
5
  }
7
6
 
8
7
  /**
@@ -11,9 +10,6 @@ export const defaultOptions = {
11
10
  * @returns
12
11
  */
13
12
  export const getFullOptions = (options) => {
14
- const fullOptions = {
15
- ...defaultOptions,
16
- nodeComponentImports: { ...defaultOptions.nodeComponentImports, ...options.nodeComponentImports }
17
- }
13
+ const fullOptions = { ...defaultOptions }
18
14
  return /** @type import('../types.js').VjsfCompileOptions */ (fullOptions)
19
15
  }
@@ -39,7 +39,7 @@ const emit = defineEmits(emits)
39
39
  const { el, statefulLayout, stateTree } = useVjsf(
40
40
  null,
41
41
  computed(() => props.modelValue),
42
- computed(() => props.options),
42
+ computed(() => ({...props.options, components: <%- JSON.stringify(pluginsComponents) %>})),
43
43
  nodeComponents,
44
44
  emit,
45
45
  null,
@@ -45,7 +45,7 @@ const titleClass = computed(() => {
45
45
  </p>
46
46
  <v-alert
47
47
  v-if="node.error && node.validated"
48
- v-bind="node.options.errorAlertProps"
48
+ type="error"
49
49
  :class="`mt-${titleDepthBase - node.options.titleDepth}`"
50
50
  :density="node.options.density"
51
51
  >
@@ -53,4 +53,3 @@ const titleClass = computed(() => {
53
53
  </v-alert>
54
54
  </div>
55
55
  </template>
56
- ../../../types.js
@@ -28,7 +28,7 @@ const fieldProps = computed(() => {
28
28
  })
29
29
 
30
30
  const menuProps = computed(() => {
31
- const menuProps = getCompProps(props.modelValue, 'menu', false)
31
+ const menuProps = getCompProps(props.modelValue)
32
32
  menuProps.closeOnContentClick = false
33
33
  menuProps.disabled = true
34
34
  return menuProps
@@ -35,7 +35,7 @@ const nodeClasses = computed(() => {
35
35
  return classes
36
36
  })
37
37
 
38
- if (!props.statefulLayout.options.nodeComponents[props.modelValue.layout.comp]) {
38
+ if (props.modelValue.layout.comp !== 'none' && !props.statefulLayout.options.nodeComponents[props.modelValue.layout.comp]) {
39
39
  console.error(`vjsf: missing component to render vjsf node "${props.modelValue.layout.comp}", maybe you forgot to register a component from a plugin ?`)
40
40
  }
41
41
 
@@ -16,7 +16,12 @@ const props = defineProps({
16
16
  }
17
17
  })
18
18
 
19
- const fieldProps = computed(() => getInputProps(props.modelValue, props.statefulLayout))
19
+ const fieldProps = computed(() => {
20
+ const inputProps = getInputProps(props.modelValue, props.statefulLayout)
21
+ // it is not very common to show an error below checkboxes and switches and without hide-details=auto they take a lot of space
22
+ if (!('hideDetails' in inputProps)) inputProps.hideDetails = 'auto'
23
+ return inputProps
24
+ })
20
25
  </script>
21
26
 
22
27
  <template>
@@ -18,7 +18,8 @@ const props = defineProps({
18
18
  })
19
19
 
20
20
  const colorPickerProps = computed(() => {
21
- const colorPickerProps = getCompProps(props.modelValue, 'colorPicker', true)
21
+ const colorPickerProps = getCompProps(props.modelValue, true)
22
+ colorPickerProps.modelValue = props.modelValue.data
22
23
  return colorPickerProps
23
24
  })
24
25
  </script>
@@ -21,7 +21,7 @@ const props = defineProps({
21
21
  const vDate = useDate()
22
22
 
23
23
  const datePickerProps = computed(() => {
24
- const datePickerProps = getCompProps(props.modelValue, 'datePicker', true)
24
+ const datePickerProps = getCompProps(props.modelValue, true)
25
25
  datePickerProps.hideActions = true
26
26
  if (props.modelValue.data) datePickerProps.modelValue = new Date(props.modelValue.data)
27
27
  return datePickerProps
@@ -1,8 +1,10 @@
1
1
  <script setup>
2
- import { VExpansionPanels, VExpansionPanel, VExpansionPanelTitle, VContainer, VRow, VIcon } from 'vuetify/components'
2
+ import { VExpansionPanels, VExpansionPanel, VExpansionPanelTitle, VExpansionPanelText, VContainer, VRow, VIcon } from 'vuetify/components'
3
+ import { computed } from 'vue'
3
4
  import { isSection } from '@json-layout/core'
4
5
  import Node from '../node.vue'
5
6
  import SectionHeader from '../fragments/section-header.vue'
7
+ import { getCompProps } from '../../utils/index.js'
6
8
 
7
9
  defineProps({
8
10
  modelValue: {
@@ -21,7 +23,7 @@ defineProps({
21
23
 
22
24
  <template>
23
25
  <section-header :node="modelValue" />
24
- <v-expansion-panels>
26
+ <v-expansion-panels v-bind="getCompProps(modelValue, true)">
25
27
  <v-expansion-panel
26
28
  v-for="(child, i) of modelValue.children"
27
29
  :key="child.key"
@@ -37,16 +39,24 @@ defineProps({
37
39
  </v-icon>
38
40
  {{ child.layout.title ?? child.layout.label }}
39
41
  </v-expansion-panel-title>
40
- <v-container fluid>
41
- <v-row>
42
- <node
43
- v-for="grandChild of isSection(child) ? child.children : [child]"
44
- :key="grandChild.fullKey"
45
- :model-value="/** @type import('../../types.js').VjsfNode */(grandChild)"
46
- :stateful-layout="statefulLayout"
47
- />
48
- </v-row>
49
- </v-container>
42
+ <v-expansion-panel-text>
43
+ <v-container fluid>
44
+ <v-row>
45
+ <node
46
+ v-for="grandChild of isSection(child) ? child.children : [child]"
47
+ :key="grandChild.fullKey"
48
+ :model-value="/** @type import('../../types.js').VjsfNode */(grandChild)"
49
+ :stateful-layout="statefulLayout"
50
+ />
51
+ </v-row>
52
+ </v-container>
53
+ </v-expansion-panel-text>
50
54
  </v-expansion-panel>
51
55
  </v-expansion-panels>
52
56
  </template>
57
+
58
+ <style>
59
+ .vjsf-node-expansion-panels .v-expansion-panel-text__wrapper {
60
+ padding: 0;
61
+ }
62
+ </style>
@@ -48,6 +48,12 @@ const buttonDensity = computed(() => {
48
48
  return props.modelValue.options.density
49
49
  })
50
50
 
51
+ const pushEmptyItem = () => {
52
+ const newData = (props.modelValue.data ?? []).concat([undefined])
53
+ props.statefulLayout.input(props.modelValue, newData)
54
+ props.statefulLayout.activateItem(props.modelValue, newData.length - 1)
55
+ }
56
+
51
57
  </script>
52
58
 
53
59
  <template>
@@ -180,7 +186,7 @@ const buttonDensity = computed(() => {
180
186
  <v-btn
181
187
  color="primary"
182
188
  :density="modelValue.options.density"
183
- @click="statefulLayout.input(modelValue, (modelValue.data ?? []).concat([undefined]))"
189
+ @click="pushEmptyItem"
184
190
  >
185
191
  {{ modelValue.messages.addItem }}
186
192
  </v-btn>
@@ -16,9 +16,12 @@ const props = defineProps({
16
16
  }
17
17
  })
18
18
 
19
- const fieldProps = computed(() =>
20
- getInputProps(props.modelValue, props.statefulLayout)
21
- )
19
+ const fieldProps = computed(() => {
20
+ const inputProps = getInputProps(props.modelValue, props.statefulLayout)
21
+ // it is not very common to show an error below checkboxes and switches and without hide-details=auto they take a lot of space
22
+ if (!('hideDetails' in inputProps)) inputProps.hideDetails = 'auto'
23
+ return inputProps
24
+ })
22
25
  </script>
23
26
 
24
27
  <template>
@@ -1,8 +1,8 @@
1
1
  /** @type {import("../types.js").PartialVjsfOptions} */
2
2
  export const defaultOptions = {
3
- errorAlertProps: { type: 'error', variant: 'tonal' },
4
3
  nodeComponents: {},
5
- plugins: {}
4
+ plugins: [],
5
+ pluginsOptions: {}
6
6
  }
7
7
 
8
8
  /**
@@ -11,10 +11,19 @@ export const defaultOptions = {
11
11
  * @param {any} form
12
12
  * @param {number} width
13
13
  * @param {import("vue").Slots} slots
14
- * @param {Record<string, import('vue').Component>} nodeComponents
14
+ * @param {Record<string, import('vue').Component>} defaultNodeComponents
15
15
  * @returns
16
16
  */
17
- export const getFullOptions = (options, form, width, slots, nodeComponents) => {
17
+ export const getFullOptions = (options, form, width, slots, defaultNodeComponents) => {
18
+ const components = options?.components ?? {}
19
+ const nodeComponents = { ...defaultNodeComponents, ...options?.nodeComponents }
20
+ if (options?.plugins) {
21
+ for (const plugin of options.plugins) {
22
+ components[plugin.info.name] = plugin.info
23
+ nodeComponents[plugin.info.name] = plugin.nodeComponent
24
+ }
25
+ }
26
+
18
27
  const fullOptions = {
19
28
  ...defaultOptions,
20
29
  readOnly: !!(form && (form.isDisabled.value || form.isReadonly.value)),
@@ -22,7 +31,8 @@ export const getFullOptions = (options, form, width, slots, nodeComponents) => {
22
31
  context: options?.context ? JSON.parse(JSON.stringify(options.context)) : {},
23
32
  width: Math.round(width ?? 0),
24
33
  vjsfSlots: { ...slots },
25
- nodeComponents: { ...nodeComponents, ...options?.nodeComponents }
34
+ components,
35
+ nodeComponents
26
36
  }
27
37
  return /** @type import('../types.js').VjsfOptions */ (fullOptions)
28
38
  }
@@ -1,8 +1,11 @@
1
- import { StatefulLayout } from '@json-layout/core'
1
+ import { StatefulLayout, produceCompileOptions } from '@json-layout/core'
2
2
  import { inject, toRaw, shallowRef, computed, ref, watch, useSlots } from 'vue'
3
3
  import { useElementSize } from '@vueuse/core'
4
4
  import { getFullOptions } from '../components/options.js'
5
- import { registeredNodeComponents } from '../utils/index.js'
5
+ import { setAutoFreeze } from 'immer'
6
+
7
+ // immer freezing is disabled because it is not compatible with Vue 3 reactivity
8
+ setAutoFreeze(false)
6
9
 
7
10
  export const emits = {
8
11
  /**
@@ -26,6 +29,8 @@ export const emits = {
26
29
  */
27
30
  export const useVjsf = (schema, modelValue, options, nodeComponents, emit, compile, precompiledLayout) => {
28
31
  const el = ref(null)
32
+
33
+ // TODO: apply a debounce to width ?
29
34
  const { width } = useElementSize(el)
30
35
 
31
36
  /** @type import('vue').ShallowRef<import('../types.js').VjsfStatefulLayout | null> */
@@ -49,19 +54,28 @@ export const useVjsf = (schema, modelValue, options, nodeComponents, emit, compi
49
54
 
50
55
  const slots = useSlots()
51
56
 
52
- const fullOptions = computed(() => getFullOptions(options.value, form, width.value, slots, { ...nodeComponents, ...toRaw(registeredNodeComponents.value) }))
57
+ const fullOptions = computed(() => getFullOptions(options.value, form, width.value, slots, { ...nodeComponents }))
58
+
59
+ // do not use a simple computed here as we want to prevent recompiling the layout when the options are the same
60
+ /** @type {import('vue').Ref<import('@json-layout/core').PartialCompileOptions>} */
61
+ const compileOptions = ref({})
62
+ watch(fullOptions, (newOptions) => {
63
+ if (precompiledLayout?.value) return
64
+ const newCompileOptions = produceCompileOptions(compileOptions.value, newOptions)
65
+ console.log('compile options', newOptions, newCompileOptions)
66
+ if (newCompileOptions !== compileOptions.value) compileOptions.value = newCompileOptions
67
+ }, { immediate: true })
53
68
 
54
69
  const compiledLayout = computed(() => {
55
70
  if (precompiledLayout?.value) return precompiledLayout?.value
56
71
  if (!compile) throw new Error('compile function is not available')
57
- const compiledLayout = compile(schema.value, fullOptions.value)
72
+ const compiledLayout = compile(schema.value, compileOptions.value)
58
73
  return compiledLayout
59
74
  })
60
75
 
61
76
  const onStatefulLayoutUpdate = () => {
62
77
  if (!statefulLayout.value) return
63
78
  stateTree.value = statefulLayout.value.stateTree
64
- emit('update:modelValue', statefulLayout.value.data)
65
79
  emit('update:state', statefulLayout.value)
66
80
  if (form) {
67
81
  // cf https://vuetifyjs.com/en/components/forms/#validation-state
@@ -71,8 +85,15 @@ export const useVjsf = (schema, modelValue, options, nodeComponents, emit, compi
71
85
  }
72
86
  }
73
87
 
88
+ const onDataUpdate = () => {
89
+ if (statefulLayout.value && modelValue !== statefulLayout.value.data) {
90
+ emit('update:modelValue', statefulLayout.value.data)
91
+ }
92
+ }
93
+
74
94
  const initStatefulLayout = () => {
75
95
  if (!width.value) return
96
+
76
97
  // @ts-ignore
77
98
  const _statefulLayout = /** @type {import('../types.js').VjsfStatefulLayout} */(new StatefulLayout(
78
99
  toRaw(compiledLayout.value),
@@ -82,9 +103,13 @@ export const useVjsf = (schema, modelValue, options, nodeComponents, emit, compi
82
103
  ))
83
104
  statefulLayout.value = _statefulLayout
84
105
  onStatefulLayoutUpdate()
106
+ onDataUpdate()
85
107
  _statefulLayout.events.on('update', () => {
86
108
  onStatefulLayoutUpdate()
87
109
  })
110
+ _statefulLayout.events.on('data', () => {
111
+ onDataUpdate()
112
+ })
88
113
  emit('update:state', _statefulLayout)
89
114
  _statefulLayout.events.on('autofocus', () => {
90
115
  if (!el.value) return
@@ -97,10 +122,8 @@ export const useVjsf = (schema, modelValue, options, nodeComponents, emit, compi
97
122
  })
98
123
  }
99
124
 
125
+ // case where options are updated from outside
100
126
  watch(fullOptions, (newOptions) => {
101
- // in case of runtime compilation the watch on compiledLayout will be triggered
102
- if (!precompiledLayout?.value) return
103
-
104
127
  if (statefulLayout.value) {
105
128
  statefulLayout.value.options = newOptions
106
129
  } else {
@@ -113,7 +136,7 @@ export const useVjsf = (schema, modelValue, options, nodeComponents, emit, compi
113
136
  if (statefulLayout.value && statefulLayout.value.data !== newData) statefulLayout.value.data = toRaw(newData)
114
137
  })
115
138
 
116
- // case where schema is updated from outside
139
+ // case where schema or compile options are updated from outside
117
140
  watch(compiledLayout, (newCompiledLayout) => {
118
141
  initStatefulLayout()
119
142
  })
package/src/types.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import { Component } from 'vue'
2
2
 
3
+ import { ComponentInfo } from '@json-layout/vocabulary'
4
+
3
5
  import {
4
6
  StatefulLayout,
5
7
  StatefulLayoutOptions,
@@ -22,29 +24,37 @@ import {
22
24
  VerticalTabsNode,
23
25
  StepperNode,
24
26
  ComboboxNode,
25
- MarkdownNode,
26
27
  FileInputNode,
27
28
  CompileOptions
28
29
  } from '@json-layout/core'
29
30
 
30
31
  export type Density = 'default' | 'comfortable' | 'compact'
31
32
 
33
+ export type Plugin = {
34
+ info: ComponentInfo,
35
+ nodeComponent: Component
36
+ }
37
+
38
+ // these options used to contain many possibilities to override props in various components
39
+ // this was unmaintainable and has been removed, customization of components should be done via slots
40
+ // and vuetify defaults providers
32
41
  export type VjsfStatefulLayoutOptions = StatefulLayoutOptions & {
33
42
  vjsfSlots: Record<string, () => unknown>,
34
43
  nodeComponents: Record<string, Component>,
35
- plugins: Record<string, unknown>
44
+ plugins: Plugin[]
45
+ pluginsOptions: Record<string, unknown>
36
46
  }
37
47
 
38
48
  export type VjsfCompileOptions = CompileOptions & {
39
- nodeComponentImports: Record<string, string>
49
+ pluginsImports: string[]
40
50
  }
41
51
 
42
52
  export type VjsfOptions = VjsfCompileOptions & VjsfStatefulLayoutOptions
43
53
 
44
54
  export type VjsfStatefulLayout = Omit<StatefulLayout, 'options'> & {options: VjsfStatefulLayoutOptions}
45
55
 
46
- export type PartialVjsfCompileOptions = Partial<Omit<VjsfCompileOptions, 'width'>>
47
- export type PartialVjsfOptions = Partial<Omit<VjsfOptions, 'width'>>
56
+ export type PartialVjsfCompileOptions = Partial<VjsfCompileOptions>
57
+ export type PartialVjsfOptions = Partial<Omit<VjsfOptions, 'width' | 'vjsfSlots'>>
48
58
 
49
59
  export type VjsfNode = Omit<StateNode, 'options'> & {options: VjsfOptions}
50
60
  export type VjsfTabsNode = Omit<TabsNode, 'options'> & {options: VjsfOptions}
@@ -62,7 +72,6 @@ export type VjsfSliderNode = Omit<SliderNode, 'options'> & {options: VjsfOptions
62
72
  export type VjsfSwitchNode = Omit<SwitchNode, 'options'> & {options: VjsfOptions}
63
73
  export type VjsfTextFieldNode = Omit<TextFieldNode, 'options'> & {options: VjsfOptions}
64
74
  export type VjsfTextareaNode = Omit<TextareaNode, 'options'> & {options: VjsfOptions}
65
- export type VjsfMarkdownNode = Omit<MarkdownNode, 'options'> & {options: VjsfOptions}
66
75
  export type VjsfVerticalTabsNode = Omit<VerticalTabsNode, 'options'> & {options: VjsfOptions}
67
76
  export type VjsfStepperNode = Omit<StepperNode, 'options'> & {options: VjsfOptions}
68
77
  export type VjsfComboboxNode = Omit<ComboboxNode, 'options'> & {options: VjsfOptions}
@@ -1 +1 @@
1
- export { commonjsDeps } from '@json-layout/core/utils/build'
1
+ export { commonjsDeps, commonjsDepsPaths } from '@json-layout/core/utils/build'
@@ -2,4 +2,3 @@ export * from './arrays.js'
2
2
  export * from './dates.js'
3
3
  export * from './props.js'
4
4
  export * from './slots.js'
5
- export * from './global-register.js'
@@ -5,7 +5,6 @@ import { camelize } from 'vue'
5
5
  // but it was not very flexible and not very easy to use, user defined props should be managed
6
6
  // by a combination of layout.props, layout.getProps and vuetify defaults provider (https://vuetifyjs.com/en/components/defaults-providers/#usage)
7
7
  const defaultProps = {
8
- fieldProps: {},
9
8
  fieldPropsCompact: {
10
9
  density: 'compact',
11
10
  hideDetails: 'auto'
@@ -14,16 +13,7 @@ const defaultProps = {
14
13
  density: 'comfortable'
15
14
  },
16
15
  fieldPropsReadOnly: { hideDetails: 'auto', variant: 'plain' },
17
- fieldPropsSummary: { hideDetails: true },
18
- textfieldProps: {},
19
- textfieldPropsReadOnly: {},
20
- textareaProps: {},
21
- textareaPropsReadOnly: {},
22
- // it is not very common to show an error below checkboxes and switches and without hide-details=auto they take a lot of space
23
- checkboxProps: { hideDetails: 'auto' },
24
- checkboxPropsReadOnly: {},
25
- switchProps: { hideDetails: 'auto' },
26
- switchPropsReadOnly: {}
16
+ fieldPropsSummary: { hideDetails: true }
27
17
  }
28
18
 
29
19
  /**
@@ -57,21 +47,17 @@ export function mergePropsLevels (propsLevels) {
57
47
  * @param {import('../types.js').VjsfNode} node
58
48
  * @param {import('../types.js').VjsfStatefulLayout} statefulLayout
59
49
  * @param {(string | [string, string])[]} [layoutPropsMap]
60
- * @param {boolean} isMainComp
50
+ * @param {boolean} [isMainComp]
61
51
  * @returns {Record<string, any>}
62
52
  */
63
53
  export function getInputProps (node, statefulLayout, layoutPropsMap, isMainComp = true) {
64
54
  const options = node.options
65
55
  /** @type {(Record<string, any> | undefined)[]} */
66
- const propsLevels = [defaultProps.fieldProps]
56
+ const propsLevels = []
67
57
  if (options.density === 'comfortable') propsLevels.push(defaultProps.fieldPropsComfortable)
68
58
  if (options.density === 'compact') propsLevels.push(defaultProps.fieldPropsCompact)
69
59
  if (node.options.readOnly) propsLevels.push(defaultProps.fieldPropsReadOnly)
70
- if (isMainComp) {
71
- propsLevels.push(/** @type Record<string, any> | undefined */(options[`${node.layout.comp}Props`]))
72
- if (node.options.readOnly) propsLevels.push(/** @type Record<string, any> | undefined */(options[`${node.layout.comp}PropsReadOnly`]))
73
- if (node.props) propsLevels.push(node.props)
74
- }
60
+ if (isMainComp && node.props) propsLevels.push(node.props)
75
61
 
76
62
  const fullProps = mergePropsLevels(propsLevels)
77
63
 
@@ -79,7 +65,7 @@ export function getInputProps (node, statefulLayout, layoutPropsMap, isMainComp
79
65
  if (node.error && node.validated) {
80
66
  fullProps.errorMessages = node.error
81
67
  }
82
- fullProps.modelValue = node.data
68
+ fullProps.modelValue = (typeof node.data === 'string' && node.layout.separator) ? node.data.split(/** @type {string} */(node.layout.separator)) : node.data
83
69
  if (node.options.readOnly) {
84
70
  fullProps.disabled = true
85
71
  fullProps.class.push('vjsf-input--readonly')
@@ -96,7 +82,9 @@ export function getInputProps (node, statefulLayout, layoutPropsMap, isMainComp
96
82
  }
97
83
 
98
84
  if (isMainComp) {
99
- fullProps['onUpdate:modelValue'] = (/** @type string */value) => statefulLayout.input(node, value)
85
+ fullProps['onUpdate:modelValue'] = (/** @type string */value) => {
86
+ return statefulLayout.input(node, (Array.isArray(value) && node.layout.separator) ? value.join(/** @type {string} */(node.layout.separator)) : value)
87
+ }
100
88
  fullProps.onBlur = () => statefulLayout.blur(node)
101
89
  }
102
90
 
@@ -106,18 +94,14 @@ export function getInputProps (node, statefulLayout, layoutPropsMap, isMainComp
106
94
  // calculate the props of components that are not of the field category
107
95
  /**
108
96
  * @param {import('@json-layout/core').StateNode} node
109
- * @param {string} comp
110
97
  * @param {boolean} isMainComp
111
98
  * @returns {Record<string, any>}
112
99
  */
113
- export function getCompProps (node, comp, isMainComp = true) {
100
+ export function getCompProps (node, isMainComp = true) {
114
101
  const options = /** @type import('../types.js').VjsfOptions */(node.options)
115
102
  /** @type {(Record<string, any> | undefined)[]} */
116
103
  const propsLevels = [{ density: options.density }]
117
- propsLevels.push(/** @type Record<string, any> | undefined */(options[`${comp}Props`]))
118
- if (node.options.readOnly) propsLevels.push(/** @type Record<string, any> | undefined */(options[`${comp}PropsReadOnly`]))
119
104
  if (isMainComp) propsLevels.push(node.layout.props)
120
105
  const fullProps = mergePropsLevels(propsLevels)
121
- if (isMainComp) fullProps.modelValue = node.data
122
106
  return fullProps
123
107
  }
@@ -1 +1 @@
1
- {"version":3,"file":"v2.d.ts","sourceRoot":"","sources":["../../src/compat/v2.js"],"names":[],"mappings":"AA8FA;;;;;;GAMG;AACH,kCALW,MAAM,+CAEN,MAAM,0BAkBhB;sBApHqB,KAAK"}
1
+ {"version":3,"file":"v2.d.ts","sourceRoot":"","sources":["../../src/compat/v2.js"],"names":[],"mappings":"AAoGA;;;;;;GAMG;AACH,kCALW,MAAM,+CAEN,MAAM,0BAkBhB;sBA1HqB,KAAK"}
@@ -2,7 +2,7 @@
2
2
  * @param {object} schema
3
3
  * @param {import('../types.js').PartialVjsfCompileOptions} [options]
4
4
  * @param {string} [baseImport]
5
- * @returns {string}
5
+ * @returns {Promise<string>}
6
6
  */
7
- export function compile(schema: object, options?: Partial<Omit<import("../types.js").VjsfCompileOptions, "width">> | undefined, baseImport?: string | undefined): string;
7
+ export function compile(schema: object, options?: Partial<import("../types.js").VjsfCompileOptions> | undefined, baseImport?: string | undefined): Promise<string>;
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compile/index.js"],"names":[],"mappings":"AAmCA;;;;;GAKG;AACH,gCALW,MAAM,4HAGJ,MAAM,CAyBlB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compile/index.js"],"names":[],"mappings":"AAmCA;;;;;GAKG;AACH,gCALW,MAAM,6GAGJ,QAAQ,MAAM,CAAC,CAuC3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/compile/options.js"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,6BADU,OAAO,aAAa,EAAE,yBAAyB,CAKxD;AAOM,wCAHI,OAAO,aAAa,EAAE,yBAAyB,4CASzD"}
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/compile/options.js"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,6BADU,OAAO,aAAa,EAAE,yBAAyB,CAIxD;AAOM,wCAHI,OAAO,aAAa,EAAE,yBAAyB,4CAMzD"}
@@ -1,10 +1,10 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {
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<import("vue").ExtractPropTypes<{}>>, {}, {}>;
@@ -1,10 +1,10 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {
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<import("vue").ExtractPropTypes<{}>>, {}, {}>;
@@ -1,4 +1,4 @@
1
- /** @type import("../types.js").PartialVjsfOptions */
1
+ /** @type {import("../types.js").PartialVjsfOptions} */
2
2
  export const defaultOptions: import("../types.js").PartialVjsfOptions;
3
- export function getFullOptions(options: Partial<import("../types.js").VjsfOptions>, form: any, width: number, slots: import("vue").Slots, nodeComponents: Record<string, import('vue').Component>): import("../types.js").VjsfOptions;
3
+ export function getFullOptions(options: Partial<import("../types.js").VjsfOptions> | null, form: any, width: number, slots: import("vue").Slots, defaultNodeComponents: Record<string, import('vue').Component>): import("../types.js").VjsfOptions;
4
4
  //# sourceMappingURL=options.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/components/options.js"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,6BADU,OAAO,aAAa,EAAE,kBAAkB,CA2BjD;AAWM,wCAPI,QAAQ,OAAO,aAAa,EAAE,WAAW,CAAC,QAC1C,GAAG,SACH,MAAM,SACN,OAAO,KAAK,EAAE,KAAK,kBACnB,OAAO,MAAM,EAAE,OAAO,KAAK,EAAE,SAAS,CAAC,qCAcjD"}
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/components/options.js"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,6BADW,OAAO,aAAa,EAAE,kBAAkB,CAKlD;AAWM,wCAPI,QAAQ,OAAO,aAAa,EAAE,WAAW,CAAC,GAAG,IAAI,QACjD,GAAG,SACH,MAAM,SACN,OAAO,KAAK,EAAE,KAAK,yBACnB,OAAO,MAAM,EAAE,OAAO,KAAK,EAAE,SAAS,CAAC,qCAwBjD"}
@@ -1,8 +1,8 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {
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<import("vue").ExtractPropTypes<{}>>, {}, {}>;
@@ -1,14 +1,14 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {
2
2
  $emit: ((event: "update:modelValue", data: any) => void) & ((event: "update:state", state: import("../types.js").VjsfStatefulLayout) => void);
3
- options: Partial<Omit<import("../types.js").VjsfOptions, "width">>;
4
- modelValue: any;
5
3
  schema: Record<string, any>;
6
- precompiledLayout: import("../../../node_modules/@json-layout/core/types/compile/types.js").CompiledLayout;
4
+ precompiledLayout: import("../../node_modules/@json-layout/core/types/compile/types.js").CompiledLayout;
5
+ modelValue: any;
6
+ options: Partial<Omit<import("../types.js").VjsfOptions, "width" | "vjsfSlots">> | null;
7
7
  $props: {
8
- readonly options?: Partial<Omit<import("../types.js").VjsfOptions, "width">> | undefined;
9
- readonly modelValue?: any;
10
8
  readonly schema?: Record<string, any> | undefined;
11
- readonly precompiledLayout?: import("../../../node_modules/@json-layout/core/types/compile/types.js").CompiledLayout | undefined;
9
+ readonly precompiledLayout?: import("../../node_modules/@json-layout/core/types/compile/types.js").CompiledLayout | undefined;
10
+ readonly modelValue?: any;
11
+ readonly options?: Partial<Omit<import("../types.js").VjsfOptions, "width" | "vjsfSlots">> | null | undefined;
12
12
  };
13
13
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
14
14
  export default _default;
@@ -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>, 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> | 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> | undefined): {
12
12
  el: import("vue").Ref<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":"AAMA;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,CAAC,kBAC3D,OAAO,MAAM,EAAE,OAAO,KAAK,EAAE,SAAS,CAAC,QACvC,GAAG;;;;EAmGb"}
1
+ {"version":3,"file":"use-vjsf.d.ts","sourceRoot":"","sources":["../../src/composables/use-vjsf.js"],"names":[],"mappings":"AASA;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;;;;EAuHb"}
package/types/types.d.ts CHANGED
@@ -1,35 +1,26 @@
1
1
  import { Component } from 'vue';
2
- import { StatefulLayout, StatefulLayoutOptions, StateNode, CheckboxNode, ColorPickerNode, DatePickerNode, DateTimePickerNode, TabsNode, ExpansionPanelsNode, ListNode, NumberFieldNode, OneOfSelectNode, SectionNode, SelectNode, SliderNode, SwitchNode, TextFieldNode, TextareaNode, VerticalTabsNode, StepperNode, ComboboxNode, MarkdownNode, FileInputNode, CompileOptions } from '@json-layout/core';
2
+ import { ComponentInfo } from '@json-layout/vocabulary';
3
+ import { StatefulLayout, StatefulLayoutOptions, StateNode, CheckboxNode, ColorPickerNode, DatePickerNode, DateTimePickerNode, TabsNode, ExpansionPanelsNode, ListNode, NumberFieldNode, OneOfSelectNode, SectionNode, SelectNode, SliderNode, SwitchNode, TextFieldNode, TextareaNode, VerticalTabsNode, StepperNode, ComboboxNode, FileInputNode, CompileOptions } from '@json-layout/core';
3
4
  export type Density = 'default' | 'comfortable' | 'compact';
5
+ export type Plugin = {
6
+ info: ComponentInfo;
7
+ nodeComponent: Component;
8
+ };
4
9
  export type VjsfStatefulLayoutOptions = StatefulLayoutOptions & {
5
- density: Density;
6
- fieldProps: Record<string, unknown>;
7
- fieldPropsCompact: Record<string, unknown>;
8
- fieldPropsComfortable: Record<string, unknown>;
9
- fieldPropsReadOnly: Record<string, unknown>;
10
- fieldPropsSummary: Record<string, unknown>;
11
- textfieldProps: Record<string, unknown>;
12
- textfieldPropsReadOnly: Record<string, unknown>;
13
- textareaProps: Record<string, unknown>;
14
- textareaPropsReadOnly: Record<string, unknown>;
15
- checkboxProps: Record<string, unknown>;
16
- checkboxPropsReadOnly: Record<string, unknown>;
17
- switchProps: Record<string, unknown>;
18
- switchPropsReadOnly: Record<string, unknown>;
19
- errorAlertProps: Record<string, unknown>;
20
10
  vjsfSlots: Record<string, () => unknown>;
21
- easyMDEOptions: Record<string, unknown>;
22
11
  nodeComponents: Record<string, Component>;
12
+ plugins: Plugin[];
13
+ pluginsOptions: Record<string, unknown>;
23
14
  };
24
15
  export type VjsfCompileOptions = CompileOptions & {
25
- nodeComponentImports: Record<string, string>;
16
+ pluginsImports: string[];
26
17
  };
27
18
  export type VjsfOptions = VjsfCompileOptions & VjsfStatefulLayoutOptions;
28
19
  export type VjsfStatefulLayout = Omit<StatefulLayout, 'options'> & {
29
20
  options: VjsfStatefulLayoutOptions;
30
21
  };
31
- export type PartialVjsfCompileOptions = Partial<Omit<VjsfCompileOptions, 'width'>>;
32
- export type PartialVjsfOptions = Partial<Omit<VjsfOptions, 'width'>>;
22
+ export type PartialVjsfCompileOptions = Partial<VjsfCompileOptions>;
23
+ export type PartialVjsfOptions = Partial<Omit<VjsfOptions, 'width' | 'vjsfSlots'>>;
33
24
  export type VjsfNode = Omit<StateNode, 'options'> & {
34
25
  options: VjsfOptions;
35
26
  };
@@ -78,9 +69,6 @@ export type VjsfTextFieldNode = Omit<TextFieldNode, 'options'> & {
78
69
  export type VjsfTextareaNode = Omit<TextareaNode, 'options'> & {
79
70
  options: VjsfOptions;
80
71
  };
81
- export type VjsfMarkdownNode = Omit<MarkdownNode, 'options'> & {
82
- options: VjsfOptions;
83
- };
84
72
  export type VjsfVerticalTabsNode = Omit<VerticalTabsNode, 'options'> & {
85
73
  options: VjsfOptions;
86
74
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAE/B,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,SAAS,EACT,YAAY,EACZ,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,mBAAmB,EACnB,QAAQ,EACR,eAAe,EACf,eAAe,EACf,WAAW,EACX,UAAU,EACV,UAAU,EACV,UAAU,EACV,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,cAAc,EACf,MAAM,mBAAmB,CAAA;AAE1B,MAAM,MAAM,OAAO,GAAG,S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I,CAAC,gBAAgB,EAAE,SAAS,CAAC,GAAG;IAAC,OAAO,EAAE,WAAW,CAAA;CAAC,CAAA;AAC7F,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,GAAG;IAAC,OAAO,EAAE,WAAW,CAAA;CAAC,CAAA;AACnF,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,GAAG;IAAC,OAAO,EAAE,WAAW,CAAA;CAAC,CAAA;AACrF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,GAAG;IAAC,OAAO,EAAE,WAAW,CAAA;CAAC,CAAA"}
@@ -1,2 +1,2 @@
1
- export { commonjsDeps } from "@json-layout/core/utils/build";
1
+ export { commonjsDeps, commonjsDepsPaths } from "@json-layout/core/utils/build";
2
2
  //# sourceMappingURL=build.d.ts.map
@@ -2,5 +2,4 @@ export * from "./arrays.js";
2
2
  export * from "./dates.js";
3
3
  export * from "./props.js";
4
4
  export * from "./slots.js";
5
- export * from "./global-register.js";
6
5
  //# sourceMappingURL=index.d.ts.map
@@ -9,15 +9,14 @@ export function mergePropsLevels(propsLevels: (Record<string, any> | undefined)[
9
9
  * @param {import('../types.js').VjsfNode} node
10
10
  * @param {import('../types.js').VjsfStatefulLayout} statefulLayout
11
11
  * @param {(string | [string, string])[]} [layoutPropsMap]
12
- * @param {boolean} isMainComp
12
+ * @param {boolean} [isMainComp]
13
13
  * @returns {Record<string, any>}
14
14
  */
15
- export function getInputProps(node: import('../types.js').VjsfNode, statefulLayout: import('../types.js').VjsfStatefulLayout, layoutPropsMap?: (string | [string, string])[] | undefined, isMainComp?: boolean): Record<string, any>;
15
+ export function getInputProps(node: import('../types.js').VjsfNode, statefulLayout: import('../types.js').VjsfStatefulLayout, layoutPropsMap?: (string | [string, string])[] | undefined, isMainComp?: boolean | undefined): Record<string, any>;
16
16
  /**
17
17
  * @param {import('@json-layout/core').StateNode} node
18
- * @param {string} comp
19
18
  * @param {boolean} isMainComp
20
19
  * @returns {Record<string, any>}
21
20
  */
22
- export function getCompProps(node: import('@json-layout/core').StateNode, comp: string, isMainComp?: boolean): Record<string, any>;
21
+ export function getCompProps(node: import('@json-layout/core').StateNode, isMainComp?: boolean): Record<string, any>;
23
22
  //# sourceMappingURL=props.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/utils/props.js"],"names":[],"mappings":"AAGA;;;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;AAID;;;;;;GAMG;AACH,oCANW,OAAO,aAAa,EAAE,QAAQ,kBAC9B,OAAO,aAAa,EAAE,kBAAkB,2EAExC,OAAO,GACL,OAAO,MAAM,EAAE,GAAG,CAAC,CA2C/B;AAGD;;;;;GAKG;AACH,mCALW,OAAO,mBAAmB,EAAE,SAAS,QACrC,MAAM,eACN,OAAO,GACL,OAAO,MAAM,EAAE,GAAG,CAAC,CAY/B"}
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/utils/props.js"],"names":[],"mappings":"AAkBA;;;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;AAID;;;;;;GAMG;AACH,oCANW,OAAO,aAAa,EAAE,QAAQ,kBAC9B,OAAO,aAAa,EAAE,kBAAkB,iGAGtC,OAAO,MAAM,EAAE,GAAG,CAAC,CAyC/B;AAGD;;;;GAIG;AACH,mCAJW,OAAO,mBAAmB,EAAE,SAAS,eACrC,OAAO,GACL,OAAO,MAAM,EAAE,GAAG,CAAC,CAS/B"}
@@ -1,13 +0,0 @@
1
- import { ref } from 'vue'
2
-
3
- /** @type {import('vue').Ref<Record<string, import('vue').Component>>} */
4
- export const registeredNodeComponents = ref({})
5
-
6
- /**
7
- * @param {string} name
8
- * @param {import('vue').Component} component
9
- */
10
- export function registerNodeComponent (name, component) {
11
- console.log('vjsf - register plugin node component', name)
12
- registeredNodeComponents.value[name] = component
13
- }
@@ -1,8 +0,0 @@
1
- /**
2
- * @param {string} name
3
- * @param {import('vue').Component} component
4
- */
5
- export function registerNodeComponent(name: string, component: import('vue').Component): void;
6
- /** @type {Record<string, import('vue').Component>} */
7
- export const registeredNodeComponents: Record<string, import('vue').Component>;
8
- //# sourceMappingURL=global-register.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"global-register.d.ts","sourceRoot":"","sources":["../../src/components/global-register.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,4CAHW,MAAM,aACN,OAAO,KAAK,EAAE,SAAS,QAIjC;AATD,sDAAsD;AACtD,uCADW,OAAO,MAAM,EAAE,OAAO,KAAK,EAAE,SAAS,CAAC,CACR"}
@@ -1,27 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{
2
- modelValue: {
3
- /** @type import('vue').PropType<import('../types.js').VjsfTextareaNode> */
4
- type: import('vue').PropType<import('../types.js').VjsfTextareaNode>;
5
- required: true;
6
- };
7
- statefulLayout: {
8
- /** @type import('vue').PropType<import('@json-layout/core').StatefulLayout> */
9
- type: import('vue').PropType<import('@json-layout/core').StatefulLayout>;
10
- required: true;
11
- };
12
- }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
13
- [key: string]: any;
14
- }>, any, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
15
- modelValue: {
16
- /** @type import('vue').PropType<import('../types.js').VjsfTextareaNode> */
17
- type: import('vue').PropType<import('../types.js').VjsfTextareaNode>;
18
- required: true;
19
- };
20
- statefulLayout: {
21
- /** @type import('vue').PropType<import('@json-layout/core').StatefulLayout> */
22
- type: import('vue').PropType<import('@json-layout/core').StatefulLayout>;
23
- required: true;
24
- };
25
- }>>, {}, {}>;
26
- export default _default;
27
- //# sourceMappingURL=markdown.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"markdown.vue.d.ts","sourceRoot":"","sources":["../../../src/components/nodes/markdown.vue.js"],"names":[],"mappings":";;QAWM,2EAA2E;cAAjE,OAAO,KAAK,EAAE,QAAQ,CAAC,OAAO,aAAa,EAAE,gBAAgB,CAAC;;;;QAKxE,+EAA+E;cAArE,OAAO,KAAK,EAAE,QAAQ,CAAC,OAAO,mBAAmB,EAAE,cAAc,CAAC;;;;;;;QAL5E,2EAA2E;cAAjE,OAAO,KAAK,EAAE,QAAQ,CAAC,OAAO,aAAa,EAAE,gBAAgB,CAAC;;;;QAKxE,+EAA+E;cAArE,OAAO,KAAK,EAAE,QAAQ,CAAC,OAAO,mBAAmB,EAAE,cAAc,CAAC"}
@@ -1,10 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {
2
- modelValue: import("../../../../node_modules/@json-layout/core/types/state/types.js").TextFieldNode;
3
- statefulLayout: import("@json-layout/core").StatefulLayout;
4
- $props: {
5
- readonly modelValue?: import("../../../../node_modules/@json-layout/core/types/state/types.js").TextFieldNode | undefined;
6
- readonly statefulLayout?: import("@json-layout/core").StatefulLayout | undefined;
7
- };
8
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
9
- export default _default;
10
- //# sourceMappingURL=text-field%20copy.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"text-field copy.vue.d.ts","sourceRoot":"","sources":["../../../src/components/nodes/text-field copy.vue.js"],"names":[],"mappings":""}
@@ -1,91 +0,0 @@
1
- import { Component } from 'vue';
2
- import { StatefulLayout, StatefulLayoutOptions, StateNode, CheckboxNode, ColorPickerNode, DatePickerNode, DateTimePickerNode, TabsNode, ExpansionPanelsNode, ListNode, NumberFieldNode, OneOfSelectNode, SectionNode, SelectNode, SliderNode, SwitchNode, TextFieldNode, TextareaNode, VerticalTabsNode, StepperNode, ComboboxNode, MarkdownNode, FileInputNode, CompileOptions } from '@json-layout/core';
3
- export type Density = 'default' | 'comfortable' | 'compact';
4
- export type VjsfStatefulLayoutOptions = StatefulLayoutOptions & {
5
- density: Density;
6
- fieldProps: Record<string, unknown>;
7
- fieldPropsCompact: Record<string, unknown>;
8
- fieldPropsComfortable: Record<string, unknown>;
9
- fieldPropsReadOnly: Record<string, unknown>;
10
- textfieldProps: Record<string, unknown>;
11
- textfieldPropsReadOnly: Record<string, unknown>;
12
- textareaProps: Record<string, unknown>;
13
- textareaPropsReadOnly: Record<string, unknown>;
14
- checkboxProps: Record<string, unknown>;
15
- checkboxPropsReadOnly: Record<string, unknown>;
16
- switchProps: Record<string, unknown>;
17
- switchPropsReadOnly: Record<string, unknown>;
18
- errorAlertProps: Record<string, unknown>;
19
- vjsfSlots: Record<string, () => unknown>;
20
- easyMDEOptions: Record<string, unknown>;
21
- nodeComponents: Record<string, Component>;
22
- };
23
- export type VjsfOptions = CompileOptions & VjsfStatefulLayoutOptions;
24
- export type VjsfStatefulLayout = Omit<StatefulLayout, 'options'> & {
25
- options: VjsfStatefulLayoutOptions;
26
- };
27
- export type PartialVjsfOptions = Partial<Omit<VjsfOptions, 'width'>>;
28
- export type VjsfNode = Omit<StateNode, 'options'> & {
29
- options: VjsfOptions;
30
- };
31
- export type VjsfTabsNode = Omit<TabsNode, 'options'> & {
32
- options: VjsfOptions;
33
- };
34
- export type VjsfCheckboxNode = Omit<CheckboxNode, 'options'> & {
35
- options: VjsfOptions;
36
- };
37
- export type VjsfColorPickerNode = Omit<ColorPickerNode, 'options'> & {
38
- options: VjsfOptions;
39
- };
40
- export type VjsfDatePickerNode = Omit<DatePickerNode, 'options'> & {
41
- options: VjsfOptions;
42
- };
43
- export type VjsfDateTimePickerNode = Omit<DateTimePickerNode, 'options'> & {
44
- options: VjsfOptions;
45
- };
46
- export type VjsfExpansionPanelsNode = Omit<ExpansionPanelsNode, 'options'> & {
47
- options: VjsfOptions;
48
- };
49
- export type VjsfListNode = Omit<ListNode, 'options'> & {
50
- options: VjsfOptions;
51
- };
52
- export type VjsfNumberFieldNode = Omit<NumberFieldNode, 'options'> & {
53
- options: VjsfOptions;
54
- };
55
- export type VjsfOneOfSelectNode = Omit<OneOfSelectNode, 'options'> & {
56
- options: VjsfOptions;
57
- };
58
- export type VjsfSectionNode = Omit<SectionNode, 'options'> & {
59
- options: VjsfOptions;
60
- };
61
- export type VjsfSelectNode = Omit<SelectNode, 'options'> & {
62
- options: VjsfOptions;
63
- };
64
- export type VjsfSliderNode = Omit<SliderNode, 'options'> & {
65
- options: VjsfOptions;
66
- };
67
- export type VjsfSwitchNode = Omit<SwitchNode, 'options'> & {
68
- options: VjsfOptions;
69
- };
70
- export type VjsfTextFieldNode = Omit<TextFieldNode, 'options'> & {
71
- options: VjsfOptions;
72
- };
73
- export type VjsfTextareaNode = Omit<TextareaNode, 'options'> & {
74
- options: VjsfOptions;
75
- };
76
- export type VjsfMarkdownNode = Omit<MarkdownNode, 'options'> & {
77
- options: VjsfOptions;
78
- };
79
- export type VjsfVerticalTabsNode = Omit<VerticalTabsNode, 'options'> & {
80
- options: VjsfOptions;
81
- };
82
- export type VjsfStepperNode = Omit<StepperNode, 'options'> & {
83
- options: VjsfOptions;
84
- };
85
- export type VjsfComboboxNode = Omit<ComboboxNode, 'options'> & {
86
- options: VjsfOptions;
87
- };
88
- export type VjsfFileInputNode = Omit<FileInputNode, 'options'> & {
89
- options: VjsfOptions;
90
- };
91
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.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AAC,CAAA;AACrF,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,GAAG;IAAC,OAAO,EAAE,WAAW,CAAA;CAAC,CAAA;AACrF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,GAAG;IAAC,OAAO,EAAE,WAAW,CAAA;CAAC,CAAA;AAC7F,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,GAAG;IAAC,OAAO,EAAE,WAAW,CAAA;CAAC,CAAA;AACnF,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,GAAG;IAAC,OAAO,EAAE,WAAW,CAAA;CAAC,CAAA;AACrF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,GAAG;IAAC,OAAO,EAAE,WAAW,CAAA;CAAC,CAAA"}
@@ -1,13 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {
2
- $emit: (event: "update:modelValue" | "update:state", ...args: any[]) => void;
3
- options: Partial<Omit<import("./types.js").VjsfOptions, "width">>;
4
- modelValue: string | number | boolean | Record<string, any>;
5
- schema: Record<string, any>;
6
- $props: {
7
- readonly options?: Partial<Omit<import("./types.js").VjsfOptions, "width">> | undefined;
8
- readonly modelValue?: string | number | boolean | Record<string, any> | undefined;
9
- readonly schema?: Record<string, any> | undefined;
10
- };
11
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
12
- export default _default;
13
- //# sourceMappingURL=v-jsf.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v-jsf.vue.d.ts","sourceRoot":"","sources":["../../src/components/v-jsf.vue.js"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- declare const _default: <T>(input: T) => T;
2
- export default _default;
3
- //# sourceMappingURL=clone.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"clone.d.ts","sourceRoot":"","sources":["../../src/utils/clone.js"],"names":[],"mappings":""}