|
|
@ -51,12 +51,12 @@ const uiTypesOptions = computed<typeof uiTypes>(() => { |
|
|
|
...uiTypes.filter((t) => !isEdit.value || !t.virtual), |
|
|
|
...uiTypes.filter((t) => !isEdit.value || !t.virtual), |
|
|
|
...(!isEdit.value && meta?.value?.columns?.every((c) => !c.pk) |
|
|
|
...(!isEdit.value && meta?.value?.columns?.every((c) => !c.pk) |
|
|
|
? [ |
|
|
|
? [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: UITypes.ID, |
|
|
|
name: UITypes.ID, |
|
|
|
icon: MdiIdentifierIcon, |
|
|
|
icon: MdiIdentifierIcon, |
|
|
|
virtual: 0, |
|
|
|
virtual: 0, |
|
|
|
}, |
|
|
|
}, |
|
|
|
] |
|
|
|
] |
|
|
|
: []), |
|
|
|
: []), |
|
|
|
] |
|
|
|
] |
|
|
|
}) |
|
|
|
}) |
|
|
@ -91,8 +91,11 @@ watchEffect(() => { |
|
|
|
if (antInput.value && formState.value) { |
|
|
|
if (antInput.value && formState.value) { |
|
|
|
// todo: replace setTimeout |
|
|
|
// todo: replace setTimeout |
|
|
|
setTimeout(() => { |
|
|
|
setTimeout(() => { |
|
|
|
antInput.value?.focus() |
|
|
|
// focus and select input only if active element is not an input or textarea |
|
|
|
antInput.value?.select() |
|
|
|
if (document.activeElement === document.body || document.activeElement === null) { |
|
|
|
|
|
|
|
antInput.value?.focus() |
|
|
|
|
|
|
|
antInput.value?.select() |
|
|
|
|
|
|
|
} |
|
|
|
}, 300) |
|
|
|
}, 300) |
|
|
|
} |
|
|
|
} |
|
|
|
advancedOptions.value = false |
|
|
|
advancedOptions.value = false |
|
|
@ -145,7 +148,8 @@ onMounted(() => { |
|
|
|
dropdown-class-name="nc-dropdown-column-type" |
|
|
|
dropdown-class-name="nc-dropdown-column-type" |
|
|
|
@change="onUidtOrIdTypeChange" |
|
|
|
@change="onUidtOrIdTypeChange" |
|
|
|
> |
|
|
|
> |
|
|
|
<a-select-option v-for="opt of uiTypesOptions" :key="opt.name" :value="opt.name" v-bind="validateInfos.uidt"> |
|
|
|
<a-select-option v-for="opt of uiTypesOptions" :key="opt.name" :value="opt.name" |
|
|
|
|
|
|
|
v-bind="validateInfos.uidt"> |
|
|
|
<div class="flex gap-1 items-center"> |
|
|
|
<div class="flex gap-1 items-center"> |
|
|
|
<component :is="opt.icon" class="text-grey" /> |
|
|
|
<component :is="opt.icon" class="text-grey" /> |
|
|
|
{{ opt.name }} |
|
|
|
{{ opt.name }} |
|
|
@ -159,9 +163,11 @@ onMounted(() => { |
|
|
|
<LazySmartsheetColumnDurationOptions v-if="formState.uidt === UITypes.Duration" v-model:value="formState" /> |
|
|
|
<LazySmartsheetColumnDurationOptions v-if="formState.uidt === UITypes.Duration" v-model:value="formState" /> |
|
|
|
<LazySmartsheetColumnRatingOptions v-if="formState.uidt === UITypes.Rating" v-model:value="formState" /> |
|
|
|
<LazySmartsheetColumnRatingOptions v-if="formState.uidt === UITypes.Rating" v-model:value="formState" /> |
|
|
|
<LazySmartsheetColumnCheckboxOptions v-if="formState.uidt === UITypes.Checkbox" v-model:value="formState" /> |
|
|
|
<LazySmartsheetColumnCheckboxOptions v-if="formState.uidt === UITypes.Checkbox" v-model:value="formState" /> |
|
|
|
<LazySmartsheetColumnLookupOptions v-if="!isEdit && formState.uidt === UITypes.Lookup" v-model:value="formState" /> |
|
|
|
<LazySmartsheetColumnLookupOptions v-if="!isEdit && formState.uidt === UITypes.Lookup" |
|
|
|
|
|
|
|
v-model:value="formState" /> |
|
|
|
<LazySmartsheetColumnDateOptions v-if="formState.uidt === UITypes.Date" v-model:value="formState" /> |
|
|
|
<LazySmartsheetColumnDateOptions v-if="formState.uidt === UITypes.Date" v-model:value="formState" /> |
|
|
|
<LazySmartsheetColumnRollupOptions v-if="!isEdit && formState.uidt === UITypes.Rollup" v-model:value="formState" /> |
|
|
|
<LazySmartsheetColumnRollupOptions v-if="!isEdit && formState.uidt === UITypes.Rollup" |
|
|
|
|
|
|
|
v-model:value="formState" /> |
|
|
|
<LazySmartsheetColumnLinkedToAnotherRecordOptions |
|
|
|
<LazySmartsheetColumnLinkedToAnotherRecordOptions |
|
|
|
v-if="!isEdit && formState.uidt === UITypes.LinkToAnotherRecord" |
|
|
|
v-if="!isEdit && formState.uidt === UITypes.LinkToAnotherRecord" |
|
|
|
v-model:value="formState" |
|
|
|
v-model:value="formState" |
|
|
|