Browse Source

fix: input border

pull/6500/head
sreehari jayaraj 1 year ago
parent
commit
709704f71a
  1. 11
      packages/nc-gui/components/smartsheet/Cell.vue
  2. 2
      packages/nc-gui/components/smartsheet/column/DefaultValue.vue
  3. 9
      packages/nc-gui/pages/index/[typeOrId]/form/[viewId]/index/survey.vue

11
packages/nc-gui/components/smartsheet/Cell.vue

@ -72,7 +72,9 @@ const readOnly = toRef(props, 'readOnly', false)
provide(ColumnInj, column) provide(ColumnInj, column)
provide(EditModeInj, useVModel(props, 'editEnabled', emit)) const editEnabled = useVModel(props, 'editEnabled', emit)
provide(EditModeInj, editEnabled)
provide(ActiveCellInj, active) provide(ActiveCellInj, active)
@ -187,6 +189,11 @@ onMounted(() => {
intersectionObserver.value?.observe(elementToObserve.value!) intersectionObserver.value?.observe(elementToObserve.value!)
}) })
// remove border of element when clicked outside
onClickOutside(elementToObserve as any, () => {
editEnabled.value = false
})
// disconnect the observer when the cell is unmounted // disconnect the observer when the cell is unmounted
onUnmounted(() => { onUnmounted(() => {
intersectionObserver.value?.disconnect() intersectionObserver.value?.disconnect()
@ -205,7 +212,7 @@ onUnmounted(() => {
'h-10': isForm && !isSurveyForm && !isAttachment(column) && !props.virtual, 'h-10': isForm && !isSurveyForm && !isAttachment(column) && !props.virtual,
'nc-grid-numeric-cell-left': (isForm && isNumericField && isExpandedFormOpen) || isEditColumnMenu, 'nc-grid-numeric-cell-left': (isForm && isNumericField && isExpandedFormOpen) || isEditColumnMenu,
'!min-h-40': isTextArea(column) && props.editEnabled, '!min-h-40': isTextArea(column) && props.editEnabled,
'!border-2': props.editEnabled, '!border-2': props.editEnabled && (isSurveyForm || isForm),
}, },
]" ]"
@keydown.enter.exact="navigate(NavigateDir.NEXT, $event)" @keydown.enter.exact="navigate(NavigateDir.NEXT, $event)"

2
packages/nc-gui/components/smartsheet/column/DefaultValue.vue

@ -49,7 +49,7 @@ useProvideSmartsheetRowStore(vModel, rowRef)
<div class="!my-3 text-xs">{{ $t('placeholder.defaultValue') }}</div> <div class="!my-3 text-xs">{{ $t('placeholder.defaultValue') }}</div>
<div class="flex flex-row gap-2"> <div class="flex flex-row gap-2">
<div class="border-1 flex items-center w-full px-3 my-[-4px] border-gray-300 rounded-md"> <div class="border-1 flex items-center w-full px-3 my-[-4px] border-gray-300 rounded-md">
<LazySmartsheetCell :column="vModel" :model-value="cdfValue" :edit-enabled="true" /> <LazySmartsheetCell :column="vModel" :model-value="cdfValue" :edit-enabled="true" class="!border-none" />
<component <component
:is="iconMap.close" :is="iconMap.close"
v-if="vModel.uidt !== UITypes.Year" v-if="vModel.uidt !== UITypes.Year"

9
packages/nc-gui/pages/index/[typeOrId]/form/[viewId]/index/survey.vue

@ -405,14 +405,9 @@ onMounted(() => {
</p> </p>
<div v-if="sharedFormView?.submit_another_form" class="text-center"> <div v-if="sharedFormView?.submit_another_form" class="text-center">
<button <NcButton type="primary" data-testid="nc-survey-form__btn-submit-another-form" @click="resetForm">
type="button"
class="scaling-btn bg-opacity-100"
data-testid="nc-survey-form__btn-submit-another-form"
@click="resetForm"
>
Submit Another Form Submit Another Form
</button> </NcButton>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save