@@ -24,23 +24,32 @@ interface Props {
24
24
setValue : UseFormSetValue < Schema > ;
25
25
type : number ;
26
26
schemaId : number ;
27
+ isDisabled ?: boolean ;
27
28
}
28
29
29
30
export const AttributeValueField : FC < Props > = ( {
30
31
control,
31
32
setValue,
32
33
type,
33
34
schemaId,
35
+ isDisabled = false ,
34
36
} ) => {
35
37
switch ( type ) {
36
38
case EntryAttributeTypeTypeEnum . STRING :
37
- return < StringAttributeValueField control = { control } attrId = { schemaId } /> ;
39
+ return (
40
+ < StringAttributeValueField
41
+ control = { control }
42
+ attrId = { schemaId }
43
+ isDisabled = { isDisabled }
44
+ />
45
+ ) ;
38
46
39
47
case EntryAttributeTypeTypeEnum . TEXT :
40
48
return (
41
49
< StringAttributeValueField
42
50
control = { control }
43
51
attrId = { schemaId }
52
+ isDisabled = { isDisabled }
44
53
multiline
45
54
/>
46
55
) ;
@@ -51,6 +60,7 @@ export const AttributeValueField: FC<Props> = ({
51
60
attrId = { schemaId }
52
61
control = { control }
53
62
setValue = { setValue }
63
+ isDisabled = { isDisabled }
54
64
/>
55
65
) ;
56
66
@@ -60,18 +70,26 @@ export const AttributeValueField: FC<Props> = ({
60
70
attrId = { schemaId }
61
71
control = { control }
62
72
setValue = { setValue }
73
+ isDisabled = { isDisabled }
63
74
/>
64
75
) ;
65
76
66
77
case EntryAttributeTypeTypeEnum . BOOLEAN :
67
- return < BooleanAttributeValueField attrId = { schemaId } control = { control } /> ;
78
+ return (
79
+ < BooleanAttributeValueField
80
+ attrId = { schemaId }
81
+ control = { control }
82
+ isDisabled = { isDisabled }
83
+ />
84
+ ) ;
68
85
69
86
case EntryAttributeTypeTypeEnum . OBJECT :
70
87
return (
71
88
< ObjectAttributeValueField
72
89
attrId = { schemaId }
73
90
control = { control }
74
91
setValue = { setValue }
92
+ isDisabled = { isDisabled }
75
93
/>
76
94
) ;
77
95
@@ -81,6 +99,7 @@ export const AttributeValueField: FC<Props> = ({
81
99
attrId = { schemaId }
82
100
control = { control }
83
101
setValue = { setValue }
102
+ isDisabled = { isDisabled }
84
103
/>
85
104
) ;
86
105
@@ -90,6 +109,7 @@ export const AttributeValueField: FC<Props> = ({
90
109
attrId = { schemaId }
91
110
control = { control }
92
111
setValue = { setValue }
112
+ isDisabled = { isDisabled }
93
113
/>
94
114
) ;
95
115
@@ -99,6 +119,7 @@ export const AttributeValueField: FC<Props> = ({
99
119
attrId = { schemaId }
100
120
control = { control }
101
121
setValue = { setValue }
122
+ isDisabled = { isDisabled }
102
123
/>
103
124
) ;
104
125
@@ -108,6 +129,7 @@ export const AttributeValueField: FC<Props> = ({
108
129
attrId = { schemaId }
109
130
control = { control }
110
131
setValue = { setValue }
132
+ isDisabled = { isDisabled }
111
133
multiple
112
134
/>
113
135
) ;
@@ -118,6 +140,7 @@ export const AttributeValueField: FC<Props> = ({
118
140
attrId = { schemaId }
119
141
control = { control }
120
142
setValue = { setValue }
143
+ isDisabled = { isDisabled }
121
144
multiple
122
145
/>
123
146
) ;
@@ -128,6 +151,7 @@ export const AttributeValueField: FC<Props> = ({
128
151
attrId = { schemaId }
129
152
control = { control }
130
153
setValue = { setValue }
154
+ isDisabled = { isDisabled }
131
155
multiple
132
156
/>
133
157
) ;
@@ -143,6 +167,7 @@ export const AttributeValueField: FC<Props> = ({
143
167
attrId = { schemaId }
144
168
control = { control }
145
169
setValue = { setValue }
170
+ isDisabled = { isDisabled }
146
171
/>
147
172
) ;
148
173
@@ -152,6 +177,7 @@ export const AttributeValueField: FC<Props> = ({
152
177
attrId = { schemaId }
153
178
control = { control }
154
179
setValue = { setValue }
180
+ isDisabled = { isDisabled }
155
181
withBoolean
156
182
/>
157
183
) ;
0 commit comments