Skip to content

Commit c718f0d

Browse files
committed
feat(vue-vuetify): add prepend and append slots to control renderers
1 parent 567d93d commit c718f0d

17 files changed

+148
-25
lines changed

packages/vue-vuetify/src/controls/AnyOfStringOrEnumControlRenderer.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,19 @@
2727
: undefined
2828
"
2929
:items="items"
30-
:clearable="control.enabled"
30+
:clearable="appliedOptions.clearable !== undefined ? appliedOptions.clearable : control.enabled"
3131
v-bind="vuetifyProps('v-combobox')"
3232
@update:model-value="onChange"
3333
@focus="handleFocus"
3434
@blur="handleBlur"
35-
/>
35+
>
36+
<template v-slot:prepend v-if="$slots.prepend">
37+
<slot name="prepend" />
38+
</template>
39+
<template v-slot:append v-if="$slots.append">
40+
<slot name="append" />
41+
</template>
42+
</v-combobox>
3643
</control-wrapper>
3744
</template>
3845

packages/vue-vuetify/src/controls/BooleanControlRenderer.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@
2222
@update:model-value="onChange"
2323
@focus="handleFocus"
2424
@blur="handleBlur"
25-
/>
25+
>
26+
<template v-slot:prepend v-if="$slots.prepend">
27+
<slot name="prepend" />
28+
</template>
29+
<template v-slot:append v-if="$slots.append">
30+
<slot name="append" />
31+
</template>
32+
</v-checkbox>
2633
</control-wrapper>
2734
</template>
2835

packages/vue-vuetify/src/controls/BooleanToggleControlRenderer.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@
2525
@update:model-value="onChange"
2626
@focus="handleFocus"
2727
@blur="handleBlur"
28-
/>
28+
>
29+
<template v-slot:prepend v-if="$slots.prepend">
30+
<slot name="prepend" />
31+
</template>
32+
<template v-slot:append v-if="$slots.append">
33+
<slot name="append" />
34+
</template>
35+
</v-switch>
2936
</control-wrapper>
3037
</template>
3138

packages/vue-vuetify/src/controls/DateControlRenderer.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,18 @@
1919
:error-messages="control.errors"
2020
v-bind="vuetifyProps('v-text-field')"
2121
v-model="inputModel"
22-
:clearable="control.enabled"
22+
:clearable="
23+
appliedOptions.clearable !== undefined
24+
? appliedOptions.clearable
25+
: control.enabled
26+
"
2327
@focus="handleFocus"
2428
@blur="handleBlur"
2529
v-maska:[options]="maska"
2630
>
31+
<template v-slot:prepend v-if="$slots.prepend">
32+
<slot name="prepend" />
33+
</template>
2734
<template v-slot:prepend-inner>
2835
<v-menu
2936
v-model="showMenu"
@@ -71,6 +78,9 @@
7178
</v-confirm-edit>
7279
</v-menu>
7380
</template>
81+
<template v-slot:append v-if="$slots.append">
82+
<slot name="append" />
83+
</template>
7484
</v-text-field>
7585
</control-wrapper>
7686
</template>

packages/vue-vuetify/src/controls/DateTimeControlRenderer.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@
1919
:error-messages="control.errors"
2020
v-bind="vuetifyProps('v-text-field')"
2121
v-model="inputModel"
22-
:clearable="control.enabled"
22+
:clearable="appliedOptions.clearable !== undefined ? appliedOptions.clearable : control.enabled"
2323
@focus="handleFocus"
2424
@blur="handleBlur"
2525
v-maska:[options]="maska"
2626
>
27+
<template v-slot:prepend v-if="$slots.prepend">
28+
<slot name="prepend" />
29+
</template>
2730
<template v-slot:prepend-inner>
2831
<v-menu
2932
v-model="showMenu"
@@ -194,6 +197,9 @@
194197
</v-confirm-edit>
195198
</v-menu>
196199
</template>
200+
<template v-slot:append v-if="$slots.append">
201+
<slot name="append" />
202+
</template>
197203
</v-text-field>
198204
</control-wrapper>
199205
</template>

packages/vue-vuetify/src/controls/EnumControlRenderer.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
:persistent-hint="persistentHint()"
1818
:required="control.required"
1919
:error-messages="control.errors"
20-
:clearable="control.enabled"
20+
:clearable="appliedOptions.clearable !== undefined ? appliedOptions.clearable : control.enabled"
2121
:model-value="control.data"
2222
:items="control.options"
2323
item-title="label"
@@ -26,7 +26,14 @@
2626
@update:model-value="onChange"
2727
@focus="handleFocus"
2828
@blur="handleBlur"
29-
/>
29+
>
30+
<template v-slot:prepend v-if="$slots.prepend">
31+
<slot name="prepend" />
32+
</template>
33+
<template v-slot:append v-if="$slots.append">
34+
<slot name="append" />
35+
</template>
36+
</v-select>
3037
</control-wrapper>
3138
</template>
3239

packages/vue-vuetify/src/controls/IntegerControlRenderer.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,19 @@
1919
:required="control.required"
2020
:error-messages="control.errors"
2121
:model-value="value"
22-
:clearable="control.enabled"
22+
:clearable="appliedOptions.clearable !== undefined ? appliedOptions.clearable : control.enabled"
2323
v-bind="vuetifyProps('v-text-field')"
2424
@update:model-value="onChange"
2525
@focus="handleFocus"
2626
@blur="handleBlur"
27-
></v-number-input>
27+
>
28+
<template v-slot:prepend v-if="$slots.prepend">
29+
<slot name="prepend" />
30+
</template>
31+
<template v-slot:append v-if="$slots.append">
32+
<slot name="append" />
33+
</template>
34+
</v-number-input>
2835
</control-wrapper>
2936
</template>
3037

packages/vue-vuetify/src/controls/MultiStringControlRenderer.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,20 @@
2626
? control.schema.maxLength
2727
: undefined
2828
"
29-
:clearable="control.enabled"
29+
:clearable="appliedOptions.clearable !== undefined ? appliedOptions.clearable : control.enabled"
3030
multi-line
3131
v-bind="vuetifyProps('v-textarea')"
3232
@update:model-value="onChange"
3333
@focus="handleFocus"
3434
@blur="handleBlur"
35-
/>
35+
>
36+
<template v-slot:prepend v-if="$slots.prepend">
37+
<slot name="prepend" />
38+
</template>
39+
<template v-slot:append v-if="$slots.append">
40+
<slot name="append" />
41+
</template>
42+
</v-textarea>
3643
</control-wrapper>
3744
</template>
3845

packages/vue-vuetify/src/controls/NumberControlRenderer.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,19 @@
2020
:required="control.required"
2121
:error-messages="control.errors"
2222
:model-value="value"
23-
:clearable="control.enabled"
23+
:clearable="appliedOptions.clearable !== undefined ? appliedOptions.clearable : control.enabled"
2424
v-bind="vuetifyProps('v-number-input')"
2525
@update:model-value="onChange"
2626
@focus="handleFocus"
2727
@blur="handleBlur"
28-
></v-number-input>
28+
>
29+
<template v-slot:prepend v-if="$slots.prepend">
30+
<slot name="prepend" />
31+
</template>
32+
<template v-slot:append v-if="$slots.append">
33+
<slot name="append" />
34+
</template>
35+
</v-number-input>
2936
</control-wrapper>
3037
</template>
3138

packages/vue-vuetify/src/controls/OneOfEnumControlRenderer.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
:persistent-hint="persistentHint()"
1818
:required="control.required"
1919
:error-messages="control.errors"
20-
:clearable="control.enabled"
20+
:clearable="appliedOptions.clearable !== undefined ? appliedOptions.clearable : control.enabled"
2121
:model-value="control.data"
2222
:items="control.options"
2323
item-title="label"
@@ -26,7 +26,14 @@
2626
@update:model-value="onChange"
2727
@focus="handleFocus"
2828
@blur="handleBlur"
29-
/>
29+
>
30+
<template v-slot:prepend v-if="$slots.prepend">
31+
<slot name="prepend" />
32+
</template>
33+
<template v-slot:append v-if="$slots.append">
34+
<slot name="append" />
35+
</template>
36+
</v-select>
3037
</control-wrapper>
3138
</template>
3239

0 commit comments

Comments
 (0)