@koumoul/vjsf 3.0.0-beta.2 → 3.0.0-beta.21
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 +2 -2
- package/src/compat/v2.js +56 -14
- package/src/compile/index.js +18 -4
- package/src/compile/options.js +3 -7
- package/src/compile/v-jsf-compiled.vue.ejs +1 -1
- package/src/components/fragments/help-message.vue +11 -1
- package/src/components/fragments/section-header.vue +1 -2
- package/src/components/fragments/text-field-menu.vue +1 -1
- package/src/components/node.vue +4 -3
- package/src/components/nodes/checkbox.vue +6 -1
- package/src/components/nodes/color-picker.vue +2 -1
- package/src/components/nodes/date-picker.vue +1 -1
- package/src/components/nodes/expansion-panels.vue +22 -12
- package/src/components/nodes/list.vue +136 -87
- package/src/components/nodes/one-of-select.vue +26 -18
- package/src/components/nodes/switch.vue +6 -3
- package/src/components/options.js +15 -5
- package/src/composables/use-dnd.js +1 -0
- package/src/composables/use-vjsf.js +32 -9
- package/src/types.ts +15 -6
- package/src/utils/build.js +1 -1
- package/src/utils/index.js +0 -1
- package/src/utils/props.js +9 -25
- package/types/compat/v2.d.ts.map +1 -1
- package/types/compile/index.d.ts +2 -2
- package/types/compile/index.d.ts.map +1 -1
- package/types/compile/options.d.ts.map +1 -1
- package/types/components/options.d.ts +2 -2
- package/types/components/options.d.ts.map +1 -1
- package/types/components/vjsf.vue.d.ts +2 -2
- package/types/composables/use-dnd.d.ts.map +1 -1
- package/types/composables/use-vjsf.d.ts +1 -1
- package/types/composables/use-vjsf.d.ts.map +1 -1
- package/types/types.d.ts +11 -23
- package/types/types.d.ts.map +1 -1
- package/types/utils/build.d.ts +1 -1
- package/types/utils/index.d.ts +0 -1
- package/types/utils/props.d.ts +3 -4
- package/types/utils/props.d.ts.map +1 -1
- package/src/utils/global-register.js +0 -13
- package/types/components/global-register.d.ts +0 -8
- package/types/components/global-register.d.ts.map +0 -1
- package/types/components/nodes/markdown.vue.d.ts +0 -27
- package/types/components/nodes/markdown.vue.d.ts.map +0 -1
- package/types/components/nodes/text-field copy.vue.d.ts +0 -10
- package/types/components/nodes/text-field copy.vue.d.ts.map +0 -1
- package/types/components/types.d.ts +0 -91
- package/types/components/types.d.ts.map +0 -1
- package/types/components/v-jsf.vue.d.ts +0 -13
- package/types/components/v-jsf.vue.d.ts.map +0 -1
- package/types/utils/clone.d.ts +0 -3
- package/types/utils/clone.d.ts.map +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { VSelect, VRow } from 'vuetify/components'
|
|
3
|
-
import { shallowRef, watch } from 'vue'
|
|
2
|
+
import { VSelect, VRow, VCol } from 'vuetify/components'
|
|
3
|
+
import { shallowRef, watch, computed, h } from 'vue'
|
|
4
4
|
import { isSection } from '@json-layout/core'
|
|
5
|
+
import { getInputProps, getCompSlots } from '../../utils/index.js'
|
|
5
6
|
import Node from '../node.vue'
|
|
6
7
|
|
|
7
8
|
const props = defineProps({
|
|
@@ -33,24 +34,31 @@ const onChange = (/** @type import('@json-layout/core').SkeletonTree */childTree
|
|
|
33
34
|
props.statefulLayout.activateItem(props.modelValue, props.modelValue.skeleton.childrenTrees.indexOf(childTree))
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
const fieldProps = computed(() => {
|
|
38
|
+
const fieldProps = getInputProps(props.modelValue, props.statefulLayout)
|
|
39
|
+
fieldProps.modelValue = activeChildTree.value
|
|
40
|
+
fieldProps['onUpdate:modelValue'] = onChange
|
|
41
|
+
fieldProps.returnObject = true
|
|
42
|
+
fieldProps.items = props.modelValue.skeleton.childrenTrees
|
|
43
|
+
fieldProps.itemTitle = 'title'
|
|
44
|
+
return fieldProps
|
|
45
|
+
})
|
|
36
46
|
</script>
|
|
37
47
|
|
|
38
48
|
<template>
|
|
39
|
-
<v-
|
|
40
|
-
v-if="modelValue.skeleton.childrenTrees"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
:stateful-layout="statefulLayout"
|
|
54
|
-
/>
|
|
49
|
+
<v-row>
|
|
50
|
+
<v-col v-if="modelValue.skeleton.childrenTrees">
|
|
51
|
+
<v-select
|
|
52
|
+
v-bind="fieldProps"
|
|
53
|
+
/>
|
|
54
|
+
</v-col>
|
|
55
|
+
<template v-if="modelValue.children?.[0]">
|
|
56
|
+
<node
|
|
57
|
+
v-for="grandChild of isSection(modelValue.children?.[0]) ? modelValue.children?.[0].children : modelValue.children"
|
|
58
|
+
:key="grandChild.fullKey"
|
|
59
|
+
:model-value="/** @type import('../../types.js').VjsfNode */(grandChild)"
|
|
60
|
+
:stateful-layout="statefulLayout"
|
|
61
|
+
/>
|
|
62
|
+
</template>
|
|
55
63
|
</v-row>
|
|
56
64
|
</template>
|
|
@@ -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>}
|
|
14
|
+
* @param {Record<string, import('vue').Component>} defaultNodeComponents
|
|
15
15
|
* @returns
|
|
16
16
|
*/
|
|
17
|
-
export const getFullOptions = (options, form, width, slots,
|
|
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
|
-
|
|
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 {
|
|
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
|
|
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,
|
|
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
|
|
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:
|
|
44
|
+
plugins: Plugin[]
|
|
45
|
+
pluginsOptions: Record<string, unknown>
|
|
36
46
|
}
|
|
37
47
|
|
|
38
48
|
export type VjsfCompileOptions = CompileOptions & {
|
|
39
|
-
|
|
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<
|
|
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}
|
package/src/utils/build.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { commonjsDeps } from '@json-layout/core/utils/build'
|
|
1
|
+
export { commonjsDeps, commonjsDepsPaths } from '@json-layout/core/utils/build'
|
package/src/utils/index.js
CHANGED
package/src/utils/props.js
CHANGED
|
@@ -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 = [
|
|
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) =>
|
|
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,
|
|
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
|
}
|
package/types/compat/v2.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2.d.ts","sourceRoot":"","sources":["../../src/compat/v2.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"v2.d.ts","sourceRoot":"","sources":["../../src/compat/v2.js"],"names":[],"mappings":"AAwIA;;;;;;GAMG;AACH,kCALW,MAAM,+CAEN,MAAM,0BAkBhB;sBA9JqB,KAAK"}
|
package/types/compile/index.d.ts
CHANGED
|
@@ -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<
|
|
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,
|
|
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,
|
|
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,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
|
|
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,
|
|
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,12 +1,12 @@
|
|
|
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
3
|
modelValue: any;
|
|
4
|
+
options: Partial<Omit<import("../types.js").VjsfOptions, "width" | "vjsfSlots">> | null;
|
|
5
5
|
schema: Record<string, any>;
|
|
6
6
|
precompiledLayout: import("../../../node_modules/@json-layout/core/types/compile/types.js").CompiledLayout;
|
|
7
7
|
$props: {
|
|
8
|
-
readonly options?: Partial<Omit<import("../types.js").VjsfOptions, "width">> | undefined;
|
|
9
8
|
readonly modelValue?: any;
|
|
9
|
+
readonly options?: Partial<Omit<import("../types.js").VjsfOptions, "width" | "vjsfSlots">> | null | undefined;
|
|
10
10
|
readonly schema?: Record<string, any> | undefined;
|
|
11
11
|
readonly precompiledLayout?: import("../../../node_modules/@json-layout/core/types/compile/types.js").CompiledLayout | undefined;
|
|
12
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-dnd.d.ts","sourceRoot":"","sources":["../../src/composables/use-dnd.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wDAHW,MAAM,IAAI;;;;;;0BAoBU,MAAM;;;;;;;
|
|
1
|
+
{"version":3,"file":"use-dnd.d.ts","sourceRoot":"","sources":["../../src/composables/use-dnd.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wDAHW,MAAM,IAAI;;;;;;0BAoBU,MAAM;;;;;;;4BAwBJ,MAAM;;;;EAmBtC"}
|
|
@@ -8,7 +8,7 @@ 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
14
|
stateTree: import("vue").ShallowRef<import("../../../node_modules/@json-layout/core/types/state/types.js").StateTree | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-vjsf.d.ts","sourceRoot":"","sources":["../../src/composables/use-vjsf.js"],"names":[],"mappings":"
|
|
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 {
|
|
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
|
-
|
|
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<
|
|
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
|
};
|
package/types/types.d.ts.map
CHANGED
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"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"}
|
package/types/utils/build.d.ts
CHANGED
|
@@ -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
|
package/types/utils/index.d.ts
CHANGED
package/types/utils/props.d.ts
CHANGED
|
@@ -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,
|
|
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":"
|
|
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"}
|