Browse Source

fic(nc-gui): form title and subtitle ui changes

pull/7664/head
Ramesh Mane 9 months ago
parent
commit
4ade86c367
  1. 139
      packages/nc-gui/components/smartsheet/Form.vue

139
packages/nc-gui/components/smartsheet/Form.vue

@ -553,7 +553,7 @@ useEventListener(
> >
<a-form ref="formRef" :model="formState" class="nc-form" no-style> <a-form ref="formRef" :model="formState" class="nc-form" no-style>
<!-- form header --> <!-- form header -->
<div class="flex flex-col gap-4 px-8 lg:px-12 mb-6"> <div class="flex flex-col px-4 lg:px-6">
<!-- Form logo --> <!-- Form logo -->
<!-- <div v-if="isEditable"> <!-- <div v-if="isEditable">
<div class="inline-block rounded-xl bg-gray-100 p-3"> <div class="inline-block rounded-xl bg-gray-100 p-3">
@ -566,60 +566,95 @@ useEventListener(
</div> </div>
</div> --> </div> -->
<!-- form title --> <!-- form title -->
<div
<a-form-item v-if="isEditable"> :class="[
<a-textarea `border-transparent px-4 lg:px-6`,
v-model:value="formViewData.heading" {
class="nc-form-focus-element w-full !font-bold !text-4xl !border-0 !border-b-1 !border-dashed !rounded-none !border-gray-400" 'rounded-2xl overflow-hidden border-2 cursor-pointer mb-1 py-4 lg:py-6': isEditable,
:style="{ },
'borderRightWidth': '0px !important', {
'height': '70px', 'mb-4 py-0 lg:py-0': !isEditable,
'max-height': '250px', },
'resize': 'vertical', {
}" 'hover:bg-gray-50': activeRow !== 'nc-form-heading' && isEditable,
auto-size },
size="large" {
hide-details '!hover:bg-white !ring-0 !cursor-auto': isLocked,
:disabled="isLocked" },
placeholder="Form Title" ]"
:bordered="false" @click.stop="onFormItemClick({ title: 'nc-form-heading' })"
data-testid="nc-form-heading" >
data-title="nc-form-heading" <a-form-item v-if="isEditable" class="!my-0">
@blur="updateView" <a-textarea
@keydown.enter="updateView" v-model:value="formViewData.heading"
/> class="nc-form-focus-element !p-0 !m-0 w-full !font-bold !text-2xl !border-0 !rounded-none !text-gray-900"
</a-form-item> :style="{
'borderRightWidth': '0px !important',
<div v-else class="w-full text-bold text-4xl"> 'height': '70px',
{{ formViewData.heading }} 'max-height': '250px',
'resize': 'vertical',
}"
auto-size
size="large"
hide-details
:disabled="isLocked"
placeholder="Form Title"
:bordered="false"
data-testid="nc-form-heading"
data-title="nc-form-heading"
@blur="updateView"
@keydown.enter="updateView"
/>
</a-form-item>
<div v-else class="text-bold text-2xl text-gray-900">
{{ formViewData.heading }}
</div>
</div> </div>
<!-- form description --> <!-- form description -->
<a-form-item v-if="isEditable" class="w-full"> <div
<a-textarea :class="[
v-model:value="formViewData.subheading" `border-transparent px-4 lg:px-6`,
class="nc-form-focus-element w-full !border-0 !border-b-1 !border-dashed !rounded-none !border-gray-400" {
:style="{ 'rounded-2xl overflow-hidden border-2 cursor-pointer mb-1 py-4 lg:py-6': isEditable,
'borderRightWidth': '0px !important', },
'height': '40px', {
'min-height': '40px', 'mb-4 py-0 lg:py-0': !isEditable,
'resize': 'vertical', },
}" {
size="large" 'hover:bg-gray-50': activeRow !== 'nc-form-sub-heading' && isEditable,
auto-size },
hide-details {
:placeholder="$t('msg.info.formDesc')" '!hover:bg-white !ring-0 !cursor-auto': isLocked,
:bordered="false" },
:disabled="!isEditable || isLocked" ]"
data-testid="nc-form-sub-heading" @click.stop="onFormItemClick({ title: 'nc-form-sub-heading' })"
data-title="nc-form-sub-heading" >
@blur="updateView" <a-form-item v-if="isEditable" class="w-full !my-0">
@click="updateView" <a-textarea
/> v-model:value="formViewData.subheading"
</a-form-item> class="nc-form-focus-element w-full !p-0 !m-0 !border-0 !rounded-none !text-gray-500"
:style="{
<div v-else class="w-full text-bold text-base"> borderRightWidth: '0px !important',
{{ formViewData.subheading || '---' }} resize: 'vertical',
}"
size="large"
auto-size
hide-details
:placeholder="$t('msg.info.formDesc')"
:bordered="false"
:disabled="!isEditable || isLocked"
data-testid="nc-form-sub-heading"
data-title="nc-form-sub-heading"
@blur="updateView"
@click="updateView"
/>
</a-form-item>
<div v-else class="text-bold text-base text-gray-500">
{{ formViewData.subheading || '---' }}
</div>
</div> </div>
</div> </div>

Loading…
Cancel
Save