Browse Source

fix(gui-v2): order & meta input style

pull/3030/head
Wing-Kam Wong 2 years ago
parent
commit
975ccc7332
  1. 19
      packages/nc-gui-v2/components/smartsheet/Form.vue

19
packages/nc-gui-v2/components/smartsheet/Form.vue

@ -144,7 +144,7 @@ function onMove(event: any) {
} else if (newIndex === 0) { } else if (newIndex === 0) {
element.order = (localColumns.value[1]?.order || 0) / 2 element.order = (localColumns.value[1]?.order || 0) / 2
} else { } else {
element.order = (localColumns.value[newIndex - 1]?.order || 0) + (localColumns.value[newIndex + 1].order || 0) / 2 element.order = ((localColumns.value[newIndex - 1]?.order || 0) + (localColumns.value[newIndex + 1].order || 0)) / 2
} }
saveOrUpdate(element, newIndex) saveOrUpdate(element, newIndex)
} }
@ -503,28 +503,33 @@ onMounted(async () => {
<SmartsheetCell v-model="formState[element.title]" class="nc-input" :column="element" :edit-enabled="true" /> <SmartsheetCell v-model="formState[element.title]" class="nc-input" :column="element" :edit-enabled="true" />
</a-form-item> </a-form-item>
<div v-if="activeRow === element.title"> <div v-if="activeRow === element.title">
<a-form-item class="my-0 w-1/2">
<a-input <a-input
v-model:value="element.label" v-model:value="element.label"
size="large" class="form-meta-input !bg-[#dbdbdb]"
:placeholder="$t('msg.info.formInput')" :placeholder="$t('msg.info.formInput')"
@change="updateColMeta(element)" @change="updateColMeta(element)"
> >
</a-input> </a-input>
</a-form-item>
<a-form-item class="mt-2 mb-0 w-1/2">
<a-input <a-input
v-model:value="element.description" v-model:value="element.description"
class="nc-input" class="form-meta-input !bg-[#dbdbdb]"
:placeholder="$t('msg.info.formHelpText')" :placeholder="$t('msg.info.formHelpText')"
size="large"
@change="updateColMeta(element)" @change="updateColMeta(element)"
/> />
</a-form-item>
<div>
<a-switch <a-switch
v-model:checked="element.required" v-model:checked="element.required"
class="mb-2" class="my-2"
:checked-children="$t('general.required')" :checked-children="$t('general.required')"
un-checked-children="Not Required" un-checked-children="Not Required"
@change="updateColMeta(element)" @change="updateColMeta(element)"
/> />
</div> </div>
</div>
<span class="text-gray-500">{{ element.description }}</span> <span class="text-gray-500">{{ element.description }}</span>
</div> </div>
</template> </template>
@ -591,4 +596,8 @@ onMounted(async () => {
.nc-input { .nc-input {
@apply w-full !bg-white rounded px-2 py-2 min-h-[40px] mt-2 mb-2 flex align-center border-solid border-1 border-primary; @apply w-full !bg-white rounded px-2 py-2 min-h-[40px] mt-2 mb-2 flex align-center border-solid border-1 border-primary;
} }
.form-meta-input::placeholder {
@apply text-[#3d3d3d] italic;
}
</style> </style>

Loading…
Cancel
Save