|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
<script lang="ts" setup> |
|
|
|
|
import type { Select as AntSelect } from 'ant-design-vue' |
|
|
|
|
import type { SelectOptionsType } from 'nocodb-sdk' |
|
|
|
|
import { ActiveCellInj, ColumnInj, EditModeInj, computed, inject, ref, useEventListener, watch } from '#imports' |
|
|
|
|
import { ActiveCellInj, ColumnInj, ReadonlyInj, computed, inject, ref, useEventListener, watch } from '#imports' |
|
|
|
|
|
|
|
|
|
interface Props { |
|
|
|
|
modelValue?: string | undefined |
|
|
|
@ -13,7 +13,7 @@ const emit = defineEmits(['update:modelValue'])
|
|
|
|
|
|
|
|
|
|
const column = inject(ColumnInj)! |
|
|
|
|
|
|
|
|
|
const editEnabled = inject(EditModeInj)! |
|
|
|
|
const readOnly = inject(ReadonlyInj)! |
|
|
|
|
|
|
|
|
|
const active = inject(ActiveCellInj, ref(false)) |
|
|
|
|
|
|
|
|
@ -69,11 +69,11 @@ watch(isOpen, (n, _o) => {
|
|
|
|
|
v-model:value="vModel" |
|
|
|
|
class="w-full" |
|
|
|
|
:allow-clear="!column.rqd && active" |
|
|
|
|
placeholder="Select an option" |
|
|
|
|
:placeholder="!readOnly ? 'Select an option' : ''" |
|
|
|
|
:bordered="false" |
|
|
|
|
:open="isOpen" |
|
|
|
|
:disabled="!editEnabled" |
|
|
|
|
:show-arrow="active || vModel === null" |
|
|
|
|
:disabled="readOnly" |
|
|
|
|
:show-arrow="!readOnly && (active || vModel === null)" |
|
|
|
|
@select="isOpen = false" |
|
|
|
|
@keydown="handleKeys" |
|
|
|
|
@click="isOpen = !isOpen" |
|
|
|
|