@koumoul/vjsf 3.0.0-beta.31 → 3.0.0-beta.32
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/components/fragments/child-subtitle.vue +25 -0
- package/src/components/fragments/help-message.vue +27 -13
- package/src/components/fragments/section-header.vue +2 -3
- package/src/components/node.vue +0 -1
- package/src/components/nodes/stepper.vue +2 -0
- package/src/components/nodes/tabs.vue +2 -0
- package/src/components/nodes/vertical-tabs.vue +2 -0
- package/types/components/fragments/child-subtitle.vue.d.ts +8 -0
- package/types/components/fragments/child-subtitle.vue.d.ts.map +1 -0
- package/types/components/vjsf.vue.d.ts +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koumoul/vjsf",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.32",
|
|
4
4
|
"description": "Generate forms for the vuetify UI library (vuejs) based on annotated JSON schemas.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "vitest",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"vuetify": "^3.6.8"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@json-layout/core": "0.
|
|
79
|
+
"@json-layout/core": "0.27.0",
|
|
80
80
|
"@vueuse/core": "^10.5.0",
|
|
81
81
|
"debug": "^4.3.4",
|
|
82
82
|
"ejs": "^3.1.9"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import { isSection } from '@json-layout/core'
|
|
4
|
+
|
|
5
|
+
const { modelValue } = defineProps({
|
|
6
|
+
modelValue: {
|
|
7
|
+
/** @type import('vue').PropType<import('@json-layout/core').StateNode> */
|
|
8
|
+
type: Object,
|
|
9
|
+
required: true
|
|
10
|
+
}
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
const pClass = computed(() => {
|
|
14
|
+
if (modelValue.options.density === 'default') return 'mt-1 mb-5'
|
|
15
|
+
if (modelValue.options.density === 'comfortable') return 'mb-4'
|
|
16
|
+
return 'mb-3'
|
|
17
|
+
})
|
|
18
|
+
</script>
|
|
19
|
+
<template>
|
|
20
|
+
<p
|
|
21
|
+
v-if="isSection(modelValue) && modelValue.layout.subtitle"
|
|
22
|
+
:class="`text-subtitle ${pClass}`"
|
|
23
|
+
v-html="modelValue.layout.subtitle"
|
|
24
|
+
/>
|
|
25
|
+
</template>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="vjsf-help-message">
|
|
2
|
+
<div :class="`vjsf-help-message vjsf-help-message-${node.options.density}`">
|
|
3
3
|
<v-slide-x-reverse-transition>
|
|
4
4
|
<v-alert
|
|
5
5
|
v-show="show"
|
|
@@ -11,9 +11,11 @@
|
|
|
11
11
|
<v-btn
|
|
12
12
|
color="info"
|
|
13
13
|
:class="`vjsf-help-message-toggle vjsf-help-message-toggle-${node.options.density}`"
|
|
14
|
-
:icon="show ? 'mdi-close
|
|
14
|
+
:icon="show ? 'mdi-close' : 'mdi-information-symbol'"
|
|
15
|
+
:border="0"
|
|
16
|
+
:elevation="show ? 0 : 2"
|
|
15
17
|
density="compact"
|
|
16
|
-
:size="node.options.density
|
|
18
|
+
:size="node.options.density === 'default' ? 28 : 24"
|
|
17
19
|
:title="show ? '' : node.messages.showHelp"
|
|
18
20
|
@click="show = !show"
|
|
19
21
|
/>
|
|
@@ -38,21 +40,33 @@ const show = ref(false)
|
|
|
38
40
|
<style>
|
|
39
41
|
.vjsf-help-message {
|
|
40
42
|
position: relative;
|
|
41
|
-
|
|
43
|
+
}
|
|
44
|
+
.vjsf-help-message-compact {
|
|
45
|
+
margin-top: 2px;
|
|
46
|
+
margin-bottom: 2px;
|
|
47
|
+
min-height:24px;
|
|
48
|
+
}
|
|
49
|
+
.vjsf-help-message-comfortable {
|
|
50
|
+
margin-top: 4px;
|
|
51
|
+
margin-bottom: 4px;
|
|
52
|
+
min-height:24px;
|
|
53
|
+
}
|
|
54
|
+
.vjsf-help-message-default {
|
|
55
|
+
margin-top: 6px;
|
|
56
|
+
margin-bottom: 6px;
|
|
57
|
+
min-height:28px;
|
|
42
58
|
}
|
|
43
59
|
.vjsf-help-message-toggle {
|
|
44
60
|
position: absolute;
|
|
45
|
-
top:
|
|
46
|
-
right:
|
|
61
|
+
top: 0px;
|
|
62
|
+
right: 0px;
|
|
47
63
|
z-index: 1;
|
|
48
64
|
}
|
|
49
|
-
.vjsf-help-message-
|
|
50
|
-
|
|
51
|
-
right: -4px;
|
|
65
|
+
.vjsf-help-message .v-alert {
|
|
66
|
+
padding-right: 22px;
|
|
52
67
|
}
|
|
53
|
-
.vjsf-help-message-
|
|
54
|
-
|
|
55
|
-
right: -4px;
|
|
68
|
+
.vjsf-help-message-default .v-alert {
|
|
69
|
+
padding-right: 26px;
|
|
56
70
|
}
|
|
71
|
+
|
|
57
72
|
</style>
|
|
58
|
-
../../../types.js
|
|
@@ -40,9 +40,8 @@ const titleClass = computed(() => {
|
|
|
40
40
|
<p
|
|
41
41
|
v-if="node.layout.subtitle"
|
|
42
42
|
:class="`text-subtitle mt-${titleDepthBase - node.options.titleDepth}`"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
</p>
|
|
43
|
+
v-html="node.layout.subtitle"
|
|
44
|
+
/>
|
|
46
45
|
<v-alert
|
|
47
46
|
v-if="node.error && node.validated"
|
|
48
47
|
type="error"
|
package/src/components/node.vue
CHANGED
|
@@ -62,7 +62,6 @@ if (props.modelValue.layout.comp !== 'none' && !props.statefulLayout.options.nod
|
|
|
62
62
|
<help-message
|
|
63
63
|
v-if="modelValue.layout.help && !modelValue.options.summary"
|
|
64
64
|
:node="modelValue"
|
|
65
|
-
:class="beforeAfterClasses[modelValue.options.density]"
|
|
66
65
|
/>
|
|
67
66
|
<node-slot
|
|
68
67
|
v-if="modelValue.layout.slots?.component"
|
|
@@ -4,6 +4,7 @@ import { VStepper, VStepperHeader, VStepperItem, VStepperWindow, VStepperWindowI
|
|
|
4
4
|
import { isSection } from '@json-layout/core'
|
|
5
5
|
import Node from '../node.vue'
|
|
6
6
|
import SectionHeader from '../fragments/section-header.vue'
|
|
7
|
+
import ChildSubtitle from '../fragments/child-subtitle.vue'
|
|
7
8
|
import { useDefaults } from 'vuetify'
|
|
8
9
|
|
|
9
10
|
useDefaults({}, 'VjsfStepper')
|
|
@@ -62,6 +63,7 @@ const goNext = () => {
|
|
|
62
63
|
fluid
|
|
63
64
|
class="pa-0"
|
|
64
65
|
>
|
|
66
|
+
<child-subtitle :model-value="child" />
|
|
65
67
|
<v-row>
|
|
66
68
|
<node
|
|
67
69
|
v-for="grandChild of isSection(child) ? child.children : [child]"
|
|
@@ -5,6 +5,7 @@ import { ref } from 'vue'
|
|
|
5
5
|
import { isSection } from '@json-layout/core'
|
|
6
6
|
import Node from '../node.vue'
|
|
7
7
|
import SectionHeader from '../fragments/section-header.vue'
|
|
8
|
+
import ChildSubtitle from '../fragments/child-subtitle.vue'
|
|
8
9
|
import useCompDefaults from '../../composables/use-comp-defaults.js'
|
|
9
10
|
|
|
10
11
|
useDefaults({}, 'VjsfTabs')
|
|
@@ -55,6 +56,7 @@ const tab = ref(0)
|
|
|
55
56
|
:value="i"
|
|
56
57
|
>
|
|
57
58
|
<v-container fluid>
|
|
59
|
+
<child-subtitle :model-value="child" />
|
|
58
60
|
<v-row>
|
|
59
61
|
<node
|
|
60
62
|
v-for="grandChild of isSection(child) ? child.children : [child]"
|
|
@@ -4,6 +4,7 @@ import { VTabs, VTab, VContainer, VSheet, VWindow, VWindowItem, VRow, VIcon } fr
|
|
|
4
4
|
import { ref } from 'vue'
|
|
5
5
|
import Node from '../node.vue'
|
|
6
6
|
import SectionHeader from '../fragments/section-header.vue'
|
|
7
|
+
import ChildSubtitle from '../fragments/child-subtitle.vue'
|
|
7
8
|
import { useDefaults } from 'vuetify'
|
|
8
9
|
import useCompDefaults from '../../composables/use-comp-defaults.js'
|
|
9
10
|
|
|
@@ -59,6 +60,7 @@ const tab = ref(0)
|
|
|
59
60
|
:value="i"
|
|
60
61
|
>
|
|
61
62
|
<v-container fluid>
|
|
63
|
+
<child-subtitle :model-value="child" />
|
|
62
64
|
<v-row>
|
|
63
65
|
<node
|
|
64
66
|
v-for="grandChild of isSection(child) ? child.children : [child]"
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
+
modelValue: import("../../../../node_modules/@json-layout/core/types/state/types.js").StateNode;
|
|
3
|
+
$props: {
|
|
4
|
+
modelValue?: import("../../../../node_modules/@json-layout/core/types/state/types.js").StateNode | undefined;
|
|
5
|
+
};
|
|
6
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=child-subtitle.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"child-subtitle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/fragments/child-subtitle.vue.js"],"names":[],"mappings":""}
|
|
@@ -1,13 +1,13 @@
|
|
|
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" | "vjsfSlots" | "onData" | "onUpdate" | "onAutofocus">> | null;
|
|
4
|
-
modelValue: any;
|
|
5
3
|
schema: Record<string, any>;
|
|
4
|
+
modelValue: any;
|
|
5
|
+
options: Partial<Omit<import("../types.js").VjsfOptions, "onData" | "onUpdate" | "onAutofocus" | "width" | "vjsfSlots">> | null;
|
|
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" | "vjsfSlots" | "onData" | "onUpdate" | "onAutofocus">> | null | undefined;
|
|
9
|
-
readonly modelValue?: any;
|
|
10
8
|
readonly schema?: Record<string, any> | undefined;
|
|
9
|
+
readonly modelValue?: any;
|
|
10
|
+
readonly options?: Partial<Omit<import("../types.js").VjsfOptions, "onData" | "onUpdate" | "onAutofocus" | "width" | "vjsfSlots">> | null | undefined;
|
|
11
11
|
readonly precompiledLayout?: import("../../../node_modules/@json-layout/core/types/compile/types.js").CompiledLayout | undefined;
|
|
12
12
|
};
|
|
13
13
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|