Skip to content

Commit d67086a

Browse files
committed
feat(vuetify): add chipProps
1 parent e3b7df0 commit d67086a

File tree

3 files changed

+30
-23
lines changed

3 files changed

+30
-23
lines changed

vuetify/dev/example-usage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<v-card>
55
<v-card-text>
66
<v-text-field label="" :model-value="value" @update:model-value="nextValue = $event" @blur="value=nextValue"></v-text-field>
7-
<VueCronEditor v-model="value" />
7+
<VueCronEditor v-model="value" :chipProps="{ color: 'primary' }" />
88
</v-card-text>
99
</v-card>
1010
</v-container>

vuetify/src/CronEditor.vue

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,28 @@
55
<v-row align="baseline" dense>
66
<v-col v-if="period.prefix" class="flex-grow-0">{{period.prefix}}</v-col>
77
<v-col cols="auto">
8-
<custom-select v-bind="period.attrs" :items="period.items" v-on="period.events" item-value="id" :density="density" :variant="variant"></custom-select>
8+
<custom-select
9+
v-bind="period.attrs"
10+
:items="period.items"
11+
v-on="period.events"
12+
item-value="id"
13+
:chip-props="chipProps" />
914
</v-col>
1015
<v-col v-if="period.suffix" class="flex-grow-0">{{period.suffix}}</v-col>
1116

1217
<template v-for="f in fields" :key="f.id">
1318
<v-col v-if="f.prefix" class="flex-grow-0">{{f.prefix}}</v-col>
1419
<v-col cols="auto">
15-
<custom-select v-bind="f.attrs" v-on="f.events" :selection="f.selectedStr" :cols="cols(f.id)" :items="f.items" multiple :density="density" :variant="variant" :close-on-content-click="false" clearable>
16-
</custom-select>
20+
<custom-select
21+
v-bind="f.attrs"
22+
v-on="f.events"
23+
:selection="f.selectedStr"
24+
:cols="cols(f.id)"
25+
:items="f.items"
26+
multiple
27+
:chip-props="chipProps"
28+
:menu-props="{ closeOnContentClick: false }"
29+
clearable />
1730
</v-col>
1831
<v-col v-if="f.suffix" class="flex-grow-0">{{f.suffix}}</v-col>
1932
</template>
@@ -33,13 +46,11 @@ export default {
3346
CustomSelect
3447
},
3548
props: {
36-
variant: {
37-
type: String,
38-
default: 'elevated'
39-
},
40-
density: {
41-
type: String,
42-
default: 'default'
49+
chipProps: {
50+
type: Object,
51+
default () {
52+
return {}
53+
}
4354
},
4455
cols: {
4556
type: Function,

vuetify/src/components/CustomSelect.vue

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<v-chip v-if="true" :density="density" :variant="variant">
2+
<v-chip v-if="true" v-bind="chipProps">
33

44
<template #append v-if="clearable">
55
<v-icon v-if="selectedItems.length > 0" size="small" icon="mdi-close" @click.stop="clear()">
@@ -8,7 +8,7 @@
88

99
{{selection ? selection : selectedStr}}
1010

11-
<v-menu activator="parent" :close-on-content-click="closeOnContentClick">
11+
<v-menu activator="parent" v-bind="menuProps">
1212
<v-list class="pa-0 ma-0">
1313
<v-row v-for="(itemRow, index) in itemRows" :key="index" no-gutters>
1414
<v-col v-for="(item, index) in itemRow" :key="index">
@@ -60,22 +60,18 @@ export default {
6060
type: String,
6161
default: 'unset'
6262
},
63-
variant: {
64-
type: String,
65-
default: 'elevated'
63+
menuProps: {
64+
type: Object,
65+
default: () => {}
6666
},
67-
density: {
68-
type: String,
69-
default: 'default'
67+
chipProps: {
68+
type: Object,
69+
default: () => {}
7070
},
7171
selection: {
7272
type: String,
7373
default: ''
7474
},
75-
closeOnContentClick: {
76-
type: Boolean,
77-
default: true
78-
},
7975
clearable: {
8076
type: Boolean,
8177
default: false

0 commit comments

Comments
 (0)