|
|
@ -37,6 +37,8 @@ const { modelValue, disableOptionCreation } = defineProps<Props>() |
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['update:modelValue']) |
|
|
|
const emit = defineEmits(['update:modelValue']) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { isMobileMode } = useGlobal() |
|
|
|
|
|
|
|
|
|
|
|
const column = inject(ColumnInj)! |
|
|
|
const column = inject(ColumnInj)! |
|
|
|
|
|
|
|
|
|
|
|
const readOnly = inject(ReadonlyInj)! |
|
|
|
const readOnly = inject(ReadonlyInj)! |
|
|
@ -202,6 +204,8 @@ async function addIfMissingAndSave() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const search = () => { |
|
|
|
const search = () => { |
|
|
|
|
|
|
|
if (isMobileMode.value) return |
|
|
|
|
|
|
|
|
|
|
|
searchVal.value = aselect.value?.$el?.querySelector('.ant-select-selection-search-input')?.value |
|
|
|
searchVal.value = aselect.value?.$el?.querySelector('.ant-select-selection-search-input')?.value |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -285,7 +289,7 @@ const selectedOpt = computed(() => { |
|
|
|
v-else |
|
|
|
v-else |
|
|
|
ref="aselect" |
|
|
|
ref="aselect" |
|
|
|
v-model:value="vModel" |
|
|
|
v-model:value="vModel" |
|
|
|
class="w-full overflow-hidden" |
|
|
|
class="w-full overflow-hidden xs:min-h-12" |
|
|
|
:class="{ 'caret-transparent': !hasEditRoles }" |
|
|
|
:class="{ 'caret-transparent': !hasEditRoles }" |
|
|
|
:placeholder="isEditColumn ? $t('labels.optional') : ''" |
|
|
|
:placeholder="isEditColumn ? $t('labels.optional') : ''" |
|
|
|
:allow-clear="!column.rqd && editAllowed" |
|
|
|
:allow-clear="!column.rqd && editAllowed" |
|
|
@ -294,7 +298,7 @@ const selectedOpt = computed(() => { |
|
|
|
:disabled="readOnly || !editAllowed || isLockedMode" |
|
|
|
:disabled="readOnly || !editAllowed || isLockedMode" |
|
|
|
:show-arrow="hasEditRoles && !(readOnly || isLockedMode) && active && vModel === null" |
|
|
|
:show-arrow="hasEditRoles && !(readOnly || isLockedMode) && active && vModel === null" |
|
|
|
:dropdown-class-name="`nc-dropdown-single-select-cell ${isOpen && active ? 'active' : ''}`" |
|
|
|
:dropdown-class-name="`nc-dropdown-single-select-cell ${isOpen && active ? 'active' : ''}`" |
|
|
|
:show-search="isOpen && active" |
|
|
|
:show-search="!isMobileMode && isOpen && active" |
|
|
|
@select="onSelect" |
|
|
|
@select="onSelect" |
|
|
|
@keydown="onKeydown($event)" |
|
|
|
@keydown="onKeydown($event)" |
|
|
|
@search="search" |
|
|
|
@search="search" |
|
|
|