Browse Source

fix: form view for select column

Re #2767

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/2751/head
mertmit 2 years ago
parent
commit
66525a8769
  1. 1
      packages/nc-gui/components/project/spreadsheet/components/EditableCell.vue
  2. 78
      packages/nc-gui/components/project/spreadsheet/components/editableCell/EnumListEditableCell.vue
  3. 11
      packages/nc-gui/components/project/spreadsheet/components/editableCell/SetListEditableCell.vue

1
packages/nc-gui/components/project/spreadsheet/components/EditableCell.vue

@ -83,6 +83,7 @@
v-else-if="isSet && (active || isForm) && !isLocked && !(isPublic && !isForm) && _isUIAllowed('tableRowUpdate')" v-else-if="isSet && (active || isForm) && !isLocked && !(isPublic && !isForm) && _isUIAllowed('tableRowUpdate')"
v-model="localState" v-model="localState"
:column="column" :column="column"
:is-form="isForm"
v-on="parentListeners" v-on="parentListeners"
/> />
<set-list-cell v-else-if="isSet" v-model="localState" :column="column" v-on="parentListeners" /> <set-list-cell v-else-if="isSet" v-model="localState" :column="column" v-on="parentListeners" />

78
packages/nc-gui/components/project/spreadsheet/components/editableCell/EnumListEditableCell.vue

@ -1,47 +1,45 @@
<template> <template>
<v-select <div>
v-model="localState" <v-select
:items="enumValues" v-model="localState"
:menu-props="{ bottom: true, offsetY: true }" :items="enumValues"
item-value="title" :menu-props="{ bottom: true, offsetY: true }"
solo item-value="title"
dense solo
flat dense
hide-details flat
class="mt-0" hide-details
:clearable="!column.rqd" :class="`mt-0 ${isForm ? 'form-select': ''}`"
v-on="parentListeners" :clearable="!column.rqd"
> v-on="parentListeners"
<template #selection="{ item }"> >
<div <template #selection="{ item }">
class="d-100" <div
:class="{ class="d-100"
'text-center': !isForm, :class="{
}" 'text-center': !isForm,
> }"
<v-chip small :color="item.color" class="ma-1"> >
<v-chip small :color="item.color" class="ma-1">
{{ item.title }}
</v-chip>
</div>
</template>
<template #item="{ item }">
<v-chip small :color="item.color">
{{ item.title }} {{ item.title }}
</v-chip> </v-chip>
</div> </template>
</template> <template #append>
<template #item="{ item }"> <v-icon small class="mt-1"> mdi-menu-down </v-icon>
<v-chip small :color="item.color"> </template>
{{ item.title }} </v-select>
</v-chip> </div>
</template>
<template #append>
<v-icon small class="mt-1"> mdi-menu-down </v-icon>
</template>
</v-select>
</template> </template>
<script> <script>
import colors from '@/mixins/colors';
export default { export default {
name: 'EnumListEditableCell', name: 'EnumListEditableCell',
mixins: [colors],
props: { props: {
value: String, value: String,
column: Object, column: Object,
@ -103,6 +101,14 @@ export default {
font-size: 13px !important; font-size: 13px !important;
} }
} }
.form-select {
.v-select__selections {
border: 1px solid rgba(127,130,139,0.2);
}
input {
z-index: -1;
}
}
} }
</style> </style>
<!-- <!--

11
packages/nc-gui/components/project/spreadsheet/components/editableCell/SetListEditableCell.vue

@ -12,7 +12,7 @@
solo solo
hide-details hide-details
deletable-chips deletable-chips
class="text-center mt-0" :class="`text-center mt-0 ${isForm ? 'form-select': ''}`"
> >
<template #selection="data"> <template #selection="data">
<v-chip <v-chip
@ -47,6 +47,7 @@ export default {
props: { props: {
value: String, value: String,
column: Object, column: Object,
isForm: Boolean,
}, },
computed: { computed: {
localState: { localState: {
@ -109,6 +110,14 @@ export default {
font-size: 12px !important; font-size: 12px !important;
color: gray !important; color: gray !important;
} }
.form-select {
.v-select__selections {
border: 1px solid rgba(127,130,139,0.2);
}
input {
z-index: -1;
}
}
} }
</style> </style>

Loading…
Cancel
Save