Skip to content

Commit cc44091

Browse files
committed
use control.arraySchema instead of Resolve
1 parent 2f96aef commit cc44091

File tree

2 files changed

+14
-31
lines changed

2 files changed

+14
-31
lines changed

packages/vue-vuetify/src/additional/ListWithDetailRenderer.vue

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
:disabled="
3030
!control.enabled ||
3131
(appliedOptions.restrict &&
32-
arraySchema !== undefined &&
33-
arraySchema.maxItems !== undefined &&
34-
dataLength >= arraySchema.maxItems)
32+
control.arraySchema !== undefined &&
33+
control.arraySchema.maxItems !== undefined &&
34+
dataLength >= control.arraySchema.maxItems)
3535
"
3636
>
3737
<v-icon>{{ icons.current.value.itemAdd }}</v-icon>
@@ -150,9 +150,9 @@
150150
:disabled="
151151
!control.enabled ||
152152
(appliedOptions.restrict &&
153-
arraySchema !== undefined &&
154-
arraySchema.minItems !== undefined &&
155-
dataLength <= arraySchema.minItems)
153+
control.arraySchema !== undefined &&
154+
control.arraySchema.minItems !== undefined &&
155+
dataLength <= control.arraySchema.minItems)
156156
"
157157
>
158158
<v-icon class="notranslate">{{
@@ -190,12 +190,10 @@
190190

191191
<script lang="ts">
192192
import {
193-
Resolve,
194193
composePaths,
195194
createDefaultValue,
196195
findUISchema,
197196
type ControlElement,
198-
type JsonSchema,
199197
type UISchemaElement,
200198
} from '@jsonforms/core';
201199
import {
@@ -273,13 +271,6 @@ const controlRenderer = defineComponent({
273271
this.control.uischema,
274272
);
275273
},
276-
arraySchema(): JsonSchema | undefined {
277-
return Resolve.schema(
278-
this.control.rootSchema,
279-
this.control.uischema.scope,
280-
this.control.rootSchema,
281-
);
282-
},
283274
},
284275
methods: {
285276
composePaths,

packages/vue-vuetify/src/complex/ArrayControlRenderer.vue

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
:disabled="
2424
!control.enabled ||
2525
(appliedOptions.restrict &&
26-
arraySchema !== undefined &&
27-
arraySchema.maxItems !== undefined &&
28-
dataLength >= arraySchema.maxItems)
26+
control.arraySchema !== undefined &&
27+
control.arraySchema.maxItems !== undefined &&
28+
dataLength >= control.arraySchema.maxItems)
2929
"
3030
@click="addButtonClick"
3131
>
@@ -153,9 +153,9 @@
153153
:disabled="
154154
!control.enabled ||
155155
(appliedOptions.restrict &&
156-
arraySchema !== undefined &&
157-
arraySchema.minItems !== undefined &&
158-
dataLength <= arraySchema.minItems)
156+
control.arraySchema !== undefined &&
157+
control.arraySchema.minItems !== undefined &&
158+
dataLength <= control.arraySchema.minItems)
159159
"
160160
@click="removeItemsClick($event, [index])"
161161
>
@@ -181,11 +181,9 @@
181181

182182
<script lang="ts">
183183
import {
184-
Resolve,
185184
composePaths,
186185
createDefaultValue,
187186
type ControlElement,
188-
type JsonSchema,
189187
} from '@jsonforms/core';
190188
import {
191189
DispatchRenderer,
@@ -235,20 +233,14 @@ const controlRenderer = defineComponent({
235233
},
236234
setup(props: RendererProps<ControlElement>) {
237235
const icons = useIcons();
236+
const input = useJsonFormsArrayControl(props);
238237
239238
return {
240-
...useVuetifyArrayControl(useJsonFormsArrayControl(props)),
239+
...useVuetifyArrayControl(input),
241240
icons,
242241
};
243242
},
244243
computed: {
245-
arraySchema(): JsonSchema | undefined {
246-
return Resolve.schema(
247-
this.control.rootSchema,
248-
this.control.uischema.scope,
249-
this.control.rootSchema,
250-
);
251-
},
252244
dataLength(): number {
253245
return this.control.data ? this.control.data.length : 0;
254246
},

0 commit comments

Comments
 (0)