|
|
@ -476,7 +476,7 @@ onMounted(async () => { |
|
|
|
<!-- for future implementation of cover image --> |
|
|
|
<!-- for future implementation of cover image --> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<a-card |
|
|
|
<a-card |
|
|
|
class="h-full m-0 rounded-b-0 p-4 border-none" |
|
|
|
class="m-0 rounded-b-0 p-4 border-none" |
|
|
|
:body-style="{ |
|
|
|
:body-style="{ |
|
|
|
maxWidth: '700px', |
|
|
|
maxWidth: '700px', |
|
|
|
margin: '0 auto', |
|
|
|
margin: '0 auto', |
|
|
@ -489,7 +489,7 @@ onMounted(async () => { |
|
|
|
<a-form-item v-if="isEditable" class="m-0 gap-0 p-0"> |
|
|
|
<a-form-item v-if="isEditable" class="m-0 gap-0 p-0"> |
|
|
|
<a-input |
|
|
|
<a-input |
|
|
|
v-model:value="formViewData.heading" |
|
|
|
v-model:value="formViewData.heading" |
|
|
|
class="w-full text-bold text-h3" |
|
|
|
class="w-full !font-bold !text-4xl" |
|
|
|
size="large" |
|
|
|
size="large" |
|
|
|
hide-details |
|
|
|
hide-details |
|
|
|
placeholder="Form Title" |
|
|
|
placeholder="Form Title" |
|
|
@ -532,15 +532,77 @@ onMounted(async () => { |
|
|
|
> |
|
|
|
> |
|
|
|
<template #item="{ element, index }"> |
|
|
|
<template #item="{ element, index }"> |
|
|
|
<div |
|
|
|
<div |
|
|
|
class="nc-editable item cursor-pointer hover:(bg-primary bg-opacity-10) p-3" |
|
|
|
class="nc-editable item cursor-pointer hover:(bg-primary bg-opacity-10) p-3 my-2 relative" |
|
|
|
:class="`nc-form-drag-${element.title.replaceAll(' ', '')}`" |
|
|
|
:class="[ |
|
|
|
|
|
|
|
`nc-form-drag-${element.title.replaceAll(' ', '')}`, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
'border-1': activeRow === element.title, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
]" |
|
|
|
@click="activeRow = element.title" |
|
|
|
@click="activeRow = element.title" |
|
|
|
> |
|
|
|
> |
|
|
|
|
|
|
|
<div |
|
|
|
|
|
|
|
v-if="isUIAllowed('editFormView') && !isRequired(element, element.required)" |
|
|
|
|
|
|
|
class="absolute flex top-2 right-2" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<mdi-eye-off-outline class="opacity-0 nc-field-remove-icon" @click.stop="hideColumn(index)" /> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<template v-if="activeRow === element.title"> |
|
|
|
<div class="flex"> |
|
|
|
<div class="flex"> |
|
|
|
<div class="flex flex-1"> |
|
|
|
<div |
|
|
|
|
|
|
|
class="flex flex-1 opacity-0 align-center gap-2" |
|
|
|
|
|
|
|
:class="{ 'opacity-100': activeRow === element.title }" |
|
|
|
|
|
|
|
> |
|
|
|
<div class="flex flex-row"> |
|
|
|
<div class="flex flex-row"> |
|
|
|
<mdi-drag-vertical class="flex flex-1" /> |
|
|
|
<mdi-drag-vertical class="flex flex-1" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="items-center flex"> |
|
|
|
|
|
|
|
<span |
|
|
|
|
|
|
|
class="text-xs text-gray-500 mr-2 nc-form-input-required" |
|
|
|
|
|
|
|
@click=" |
|
|
|
|
|
|
|
() => { |
|
|
|
|
|
|
|
element.required = !element.required |
|
|
|
|
|
|
|
updateColMeta(element) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
{{ $t('general.required') }} |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a-switch |
|
|
|
|
|
|
|
v-model:checked="element.required" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
class="ml-2" |
|
|
|
|
|
|
|
@change="updateColMeta(element)" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="my-3"> |
|
|
|
|
|
|
|
<a-form-item class="my-0 w-1/2 !mb-1"> |
|
|
|
|
|
|
|
<a-input |
|
|
|
|
|
|
|
v-model:value="element.label" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
class="form-meta-input !bg-[#dbdbdb] nc-form-input-label" |
|
|
|
|
|
|
|
:placeholder="$t('msg.info.formInput')" |
|
|
|
|
|
|
|
@change="updateColMeta(element)" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
</a-input> |
|
|
|
|
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a-form-item class="mt-2 mb-0 w-1/2 !mb-1"> |
|
|
|
|
|
|
|
<a-input |
|
|
|
|
|
|
|
v-model:value="element.description" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
class="form-meta-input !bg-[#dbdbdb] text-sm nc-form-input-help-text" |
|
|
|
|
|
|
|
:placeholder="$t('msg.info.formHelpText')" |
|
|
|
|
|
|
|
@change="updateColMeta(element)" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<div> |
|
|
|
<SmartsheetHeaderVirtualCell |
|
|
|
<SmartsheetHeaderVirtualCell |
|
|
|
v-if="isVirtualCol(element)" |
|
|
|
v-if="isVirtualCol(element)" |
|
|
|
:column="{ ...element, title: element.label || element.title }" |
|
|
|
:column="{ ...element, title: element.label || element.title }" |
|
|
@ -554,14 +616,10 @@ onMounted(async () => { |
|
|
|
:hide-menu="true" |
|
|
|
:hide-menu="true" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-if="isUIAllowed('editFormView') && !isRequired(element, element.required)" class="flex"> |
|
|
|
|
|
|
|
<mdi-eye-off-outline class="opacity-0 nc-field-remove-icon" @click.stop="hideColumn(index)" /> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a-form-item |
|
|
|
<a-form-item |
|
|
|
v-if="isVirtualCol(element)" |
|
|
|
v-if="isVirtualCol(element)" |
|
|
|
class="m-0 gap-0 p-0" |
|
|
|
class="!m-0 gap-0 p-0" |
|
|
|
:name="element.title" |
|
|
|
:name="element.title" |
|
|
|
:rules="[{ required: element.required, message: `${element.title} is required` }]" |
|
|
|
:rules="[{ required: element.required, message: `${element.title} is required` }]" |
|
|
|
> |
|
|
|
> |
|
|
@ -576,7 +634,7 @@ onMounted(async () => { |
|
|
|
|
|
|
|
|
|
|
|
<a-form-item |
|
|
|
<a-form-item |
|
|
|
v-else |
|
|
|
v-else |
|
|
|
class="m-0 gap-0 p-0" |
|
|
|
class="!m-0 gap-0 p-0" |
|
|
|
:name="element.title" |
|
|
|
:name="element.title" |
|
|
|
:rules="[{ required: element.required, message: `${element.title} is required` }]" |
|
|
|
:rules="[{ required: element.required, message: `${element.title} is required` }]" |
|
|
|
> |
|
|
|
> |
|
|
@ -590,36 +648,7 @@ onMounted(async () => { |
|
|
|
/> |
|
|
|
/> |
|
|
|
</a-form-item> |
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<div v-if="activeRow === element.title"> |
|
|
|
<span class="text-gray-500 text-xs -mt-1 block">{{ element.description }}</span> |
|
|
|
<a-form-item class="my-0 w-1/2"> |
|
|
|
|
|
|
|
<a-input |
|
|
|
|
|
|
|
v-model:value="element.label" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
class="form-meta-input !bg-[#dbdbdb] nc-form-input-label" |
|
|
|
|
|
|
|
:placeholder="$t('msg.info.formInput')" |
|
|
|
|
|
|
|
@change="updateColMeta(element)" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
</a-input> |
|
|
|
|
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a-form-item class="mt-2 mb-0 w-1/2"> |
|
|
|
|
|
|
|
<a-input |
|
|
|
|
|
|
|
v-model:value="element.description" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
class="form-meta-input !bg-[#dbdbdb] text-sm nc-form-input-help-text" |
|
|
|
|
|
|
|
:placeholder="$t('msg.info.formHelpText')" |
|
|
|
|
|
|
|
@change="updateColMeta(element)" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="items-center flex"> |
|
|
|
|
|
|
|
<span class="text-sm text-gray-500 mr-2 nc-form-input-required">{{ $t('general.required') }}</span> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a-switch v-model:checked="element.required" size="small" class="my-2" @change="updateColMeta(element)" /> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="text-gray-500">{{ element.description }}</span> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
@ -634,11 +663,7 @@ onMounted(async () => { |
|
|
|
</Draggable> |
|
|
|
</Draggable> |
|
|
|
|
|
|
|
|
|
|
|
<div class="justify-center flex mt-10"> |
|
|
|
<div class="justify-center flex mt-10"> |
|
|
|
<a-button |
|
|
|
<a-button type="primary" class="flex items-center gap-2 nc-form-submit" size="large" @click="submitForm"> |
|
|
|
class="flex items-center gap-2 !bg-primary text-white rounded nc-form-submit" |
|
|
|
|
|
|
|
size="large" |
|
|
|
|
|
|
|
@click="submitForm" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<!-- Submit --> |
|
|
|
<!-- Submit --> |
|
|
|
{{ $t('general.submit') }} |
|
|
|
{{ $t('general.submit') }} |
|
|
|
</a-button> |
|
|
|
</a-button> |
|
|
@ -722,4 +747,11 @@ onMounted(async () => { |
|
|
|
.form-meta-input::placeholder { |
|
|
|
.form-meta-input::placeholder { |
|
|
|
@apply text-[#3d3d3d] italic; |
|
|
|
@apply text-[#3d3d3d] italic; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.nc-form-input-label, |
|
|
|
|
|
|
|
.nc-form-input-help-text { |
|
|
|
|
|
|
|
&::placeholder { |
|
|
|
|
|
|
|
@apply !text-gray-500 !text-xs; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |
|
|
|