File tree 14 files changed +69
-25
lines changed
14 files changed +69
-25
lines changed Original file line number Diff line number Diff line change 16
16
:schema =" control.schema"
17
17
combinatorKeyword =" allOf"
18
18
:path =" path"
19
+ :rootSchema =" control.rootSchema"
19
20
/>
20
21
<dispatch-renderer
21
22
v-for =" (allOfRenderInfo, allOfIndex) in allOfRenderInfos"
Original file line number Diff line number Diff line change 4
4
:schema =" control.schema"
5
5
combinatorKeyword =" anyOf"
6
6
:path =" path"
7
+ :rootSchema =" control.rootSchema"
7
8
/>
8
9
9
10
<v-tabs v-model =" selectedIndex" >
Original file line number Diff line number Diff line change 1
1
<template >
2
- <v-card v-if =" control.visible" :class =" styles.arrayList.root" elevation =" 0" >
3
- <v-card-title >
4
- <v-toolbar flat :class =" styles.arrayList.toolbar" >
2
+ <v-card
3
+ v-if =" control.visible"
4
+ :class =" styles.arrayList.root"
5
+ elevation =" 0"
6
+ v-bind =" vuetifyProps('v-card')"
7
+ >
8
+ <v-card-title
9
+ :class =" styles.arrayList.title"
10
+ v-bind =" vuetifyProps('v-card-title')"
11
+ >
12
+ <v-toolbar
13
+ flat
14
+ :class =" styles.arrayList.toolbar"
15
+ v-bind =" vuetifyProps('v-toolbar')"
16
+ >
5
17
<v-toolbar-title :class =" styles.arrayList.label" >{{
6
18
computedLabel
7
19
}}</v-toolbar-title >
36
48
</v-tooltip >
37
49
</v-toolbar >
38
50
</v-card-title >
39
- <v-card-text >
51
+ <v-card-text v-bind = " vuetifyProps('v-card-text') " >
40
52
<v-container justify-space-around align-content-center >
41
53
<v-row justify =" center" >
42
54
<v-table
Original file line number Diff line number Diff line change 20
20
import {
21
21
Generate ,
22
22
findUISchema ,
23
- isObjectControl ,
24
- rankWith ,
25
23
type ControlElement ,
26
24
type GroupLayout ,
27
- type JsonFormsRendererRegistryEntry ,
28
25
type UISchemaElement ,
29
26
} from ' @jsonforms/core' ;
30
27
import {
@@ -76,7 +73,12 @@ const controlRenderer = defineComponent({
76
73
},
77
74
detailUiSchema(): UISchemaElement {
78
75
const uiSchemaGenerator = () => {
79
- const uiSchema = Generate .uiSchema (this .control .schema , ' Group' );
76
+ const uiSchema = Generate .uiSchema (
77
+ this .control .schema ,
78
+ ' Group' ,
79
+ undefined ,
80
+ this .control .rootSchema ,
81
+ );
80
82
if (isEmpty (this .control .path )) {
81
83
uiSchema .type = ' VerticalLayout' ;
82
84
} else {
Original file line number Diff line number Diff line change 4
4
:schema =" control.schema"
5
5
combinatorKeyword =" oneOf"
6
6
:path =" path"
7
+ :rootSchema =" control.rootSchema"
7
8
/>
8
9
9
10
<v-select
Original file line number Diff line number Diff line change 4
4
:schema =" control.schema"
5
5
combinatorKeyword =" oneOf"
6
6
:path =" path"
7
+ :rootSchema =" control.rootSchema"
7
8
/>
8
9
9
- <v-tabs v-model =" selectIndex" @update:model-value =" handleTabChange" >
10
+ <v-tabs
11
+ v-model =" selectIndex"
12
+ @update:model-value =" handleTabChange"
13
+ :disabled =" !control.enabled"
14
+ >
10
15
<v-tab
11
16
v-for =" (oneOfRenderInfo, oneOfIndex) in oneOfRenderInfos"
12
17
:key =" `${control.path}-${oneOfIndex}`"
Original file line number Diff line number Diff line change @@ -227,7 +227,12 @@ export default defineComponent({
227
227
228
228
if (propSchema ) {
229
229
if (propSchema .type === ' object' || propSchema .type === ' array' ) {
230
- propUiSchema = Generate .uiSchema (propSchema , ' Group' );
230
+ propUiSchema = Generate .uiSchema (
231
+ propSchema ,
232
+ ' Group' ,
233
+ undefined ,
234
+ control .value .rootSchema ,
235
+ );
231
236
(propUiSchema as GroupLayout ).label =
232
237
propSchema .title ?? startCase (propName );
233
238
} else {
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ interface CombinatorProps {
23
23
schema: JsonSchema ;
24
24
combinatorKeyword: ' oneOf' | ' anyOf' | ' allOf' ;
25
25
path: string ;
26
+ rootSchema: JsonSchema ;
26
27
}
27
28
28
29
export default defineComponent ({
@@ -43,6 +44,10 @@ export default defineComponent({
43
44
type: String ,
44
45
required: true ,
45
46
},
47
+ rootSchema: {
48
+ type: Object as PropType <JsonSchema >,
49
+ required: true ,
50
+ },
46
51
},
47
52
setup(props : CombinatorProps ) {
48
53
const otherProps: JsonSchema = omit (
@@ -52,6 +57,8 @@ export default defineComponent({
52
57
const foundUISchema: UISchemaElement = Generate .uiSchema (
53
58
otherProps ,
54
59
' VerticalLayout' ,
60
+ undefined ,
61
+ props .rootSchema ,
55
62
);
56
63
57
64
const isLayout = (uischema : UISchemaElement ): uischema is Layout =>
Original file line number Diff line number Diff line change 1
1
<template >
2
- <v-card v-if =" control.visible" :class =" styles.arrayList.root" >
3
- <v-card-title >
4
- <v-toolbar flat :class =" styles.arrayList.toolbar" >
2
+ <v-card
3
+ v-if =" control.visible"
4
+ :class =" styles.arrayList.root"
5
+ v-bind =" vuetifyProps('v-card')"
6
+ >
7
+ <v-card-title
8
+ :class =" styles.arrayList.title"
9
+ v-bind =" vuetifyProps('v-card-title')"
10
+ >
11
+ <v-toolbar
12
+ flat
13
+ :class =" styles.arrayList.toolbar"
14
+ v-bind =" vuetifyProps('v-toolbar')"
15
+ >
5
16
<v-toolbar-title :class =" styles.arrayList.label" >{{
6
17
computedLabel
7
18
}}</v-toolbar-title >
45
56
</slot >
46
57
</v-toolbar >
47
58
</v-card-title >
48
- <v-card-text >
59
+ <v-card-text v-bind = " vuetifyProps('v-card-text') " >
49
60
<v-container
50
61
justify-space-around
51
62
align-content-center
196
207
{{ control.translations.noDataMessage }}
197
208
</v-container >
198
209
</v-card-text >
199
- <v-card-actions v-if =" $slots.actions" class =" pb-8" >
210
+ <v-card-actions
211
+ v-if =" $slots.actions"
212
+ class =" pb-8"
213
+ v-bind =" vuetifyProps('v-card-actions')"
214
+ >
200
215
<slot
201
216
name =" actions"
202
217
:addClass =" styles.arrayList.addButton"
Original file line number Diff line number Diff line change 73
73
</template >
74
74
75
75
<script lang="ts">
76
- import {
77
- and ,
78
- categorizationHasCategory ,
79
- isCategorization ,
80
- rankWith ,
81
- type JsonFormsRendererRegistryEntry ,
82
- type Layout ,
83
- } from ' @jsonforms/core' ;
76
+ import { type Layout } from ' @jsonforms/core' ;
84
77
import {
85
78
DispatchRenderer ,
86
79
rendererProps ,
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export const defaultStyles: Styles = {
23
23
arrayList : {
24
24
root : 'array-list' ,
25
25
toolbar : 'array-list-toolbar' ,
26
+ title : 'array-list-title' ,
26
27
validationIcon : 'array-list-validation' ,
27
28
addButton : 'array-list-add' ,
28
29
label : 'array-list-label' ,
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ export interface Styles {
37
37
arrayList : {
38
38
root ?: string ;
39
39
toolbar ?: string ;
40
+ title ?: string ;
40
41
validationIcon ?: string ;
41
42
container ?: string ;
42
43
addButton ?: string ;
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ exports[`ArrayControlRenderer.vue > should render component and match snapshot 1
21
21
</div >
22
22
<!---->
23
23
<!---->
24
- <div data-v-4896f876 = " " class = " v-card-title" >
24
+ <div data-v-4896f876 = " " class = " v-card-title array-list-title " >
25
25
<header data-v-4896f876 = " " class = " v-toolbar v-toolbar--flat v-toolbar--density-default v-theme--light v-locale--is-ltr array-list-toolbar" >
26
26
<!---->
27
27
<div class = " v-toolbar__content" style = " height: 64px;" >
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ exports[`ArrayLayoutRenderer.vue > should render component and match snapshot 1`
21
21
</div >
22
22
<!---->
23
23
<!---->
24
- <div data-v-5f91636e = " " class = " v-card-title" >
24
+ <div data-v-5f91636e = " " class = " v-card-title array-list-title " >
25
25
<header data-v-5f91636e = " " class = " v-toolbar v-toolbar--flat v-toolbar--density-default v-theme--light v-locale--is-ltr array-list-toolbar" >
26
26
<!---->
27
27
<div class = " v-toolbar__content" style = " height: 64px;" >
You can’t perform that action at this time.
0 commit comments