Skip to content

Commit d460e6c

Browse files
committed
use control.arraySchema instead of Resolve, make the header to not take so much space
1 parent cc44091 commit d460e6c

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

packages/vue-vuetify/src/layouts/ArrayLayoutRenderer.vue

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@
6262
:key="`${control.path}-${control.data.length}-${index}`"
6363
:class="styles.arrayList.item"
6464
>
65-
<v-expansion-panel-title :class="styles.arrayList.itemHeader">
66-
<v-container py-0 :class="styles.arrayList.itemContainer">
65+
<v-expansion-panel-title
66+
:class="`${styles.arrayList.itemHeader} py-0`"
67+
>
68+
<v-container :class="`${styles.arrayList.itemContainer} py-0`">
6769
<v-row
6870
:style="`display: grid; grid-template-columns: ${
6971
!hideAvatar ? 'min-content' : ''
@@ -161,9 +163,9 @@
161163
:disabled="
162164
!control.enabled ||
163165
(appliedOptions.restrict &&
164-
arraySchema !== undefined &&
165-
arraySchema.minItems !== undefined &&
166-
dataLength <= arraySchema.minItems)
166+
control.arraySchema !== undefined &&
167+
control.arraySchema.minItems !== undefined &&
168+
dataLength <= control.arraySchema.minItems)
167169
"
168170
@click.stop="suggestToDelete = index"
169171
>
@@ -250,13 +252,11 @@
250252

251253
<script lang="ts">
252254
import {
253-
Resolve,
254255
composePaths,
255256
createDefaultValue,
256257
findUISchema,
257258
getControlPath,
258259
type ControlElement,
259-
type JsonSchema,
260260
type UISchemaElement,
261261
} from '@jsonforms/core';
262262
import {
@@ -351,9 +351,9 @@ const controlRenderer = defineComponent({
351351
return (
352352
!this.control.enabled ||
353353
(this.appliedOptions.restrict &&
354-
this.arraySchema !== undefined &&
355-
this.arraySchema.maxItems !== undefined &&
356-
this.dataLength >= this.arraySchema.maxItems)
354+
this.control.arraySchema !== undefined &&
355+
this.control.arraySchema.maxItems !== undefined &&
356+
this.dataLength >= this.control.arraySchema.maxItems)
357357
);
358358
},
359359
dataLength(): number {
@@ -370,13 +370,6 @@ const controlRenderer = defineComponent({
370370
this.control.rootSchema,
371371
);
372372
},
373-
arraySchema(): JsonSchema | undefined {
374-
return Resolve.schema(
375-
this.control.rootSchema,
376-
this.control.uischema.scope,
377-
this.control.rootSchema,
378-
);
379-
},
380373
hideAvatar(): boolean {
381374
return !!this.appliedOptions.hideAvatar;
382375
},

0 commit comments

Comments
 (0)