From 291532a6515ab736a3afe131c596466a22436542 Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Wed, 27 Dec 2023 12:47:46 +0530 Subject: [PATCH] fix: review changes --- packages/nc-gui/components/cell/Currency.vue | 6 ++---- packages/nc-gui/components/cell/Decimal.vue | 6 ++---- packages/nc-gui/components/cell/Duration.vue | 6 ++---- packages/nc-gui/components/cell/Email.vue | 6 ++---- packages/nc-gui/components/cell/Integer.vue | 6 ++---- packages/nc-gui/components/cell/Percent.vue | 6 ++---- packages/nc-gui/components/cell/PhoneNumber.vue | 6 ++---- packages/nc-gui/components/cell/RichText.vue | 2 +- packages/nc-gui/components/cell/Text.vue | 4 +--- packages/nc-gui/components/cell/Url.vue | 6 ++---- 10 files changed, 18 insertions(+), 36 deletions(-) diff --git a/packages/nc-gui/components/cell/Currency.vue b/packages/nc-gui/components/cell/Currency.vue index a11a8aa46f..cf38769f9c 100644 --- a/packages/nc-gui/components/cell/Currency.vue +++ b/packages/nc-gui/components/cell/Currency.vue @@ -78,10 +78,8 @@ onMounted(() => { :ref="focus" v-model="vModel" type="number" - class="w-full h-full text-sm border-none rounded-md px-0 py-1 outline-none focus:outline-none focus:ring-0" - :class="{ - '!px-2': isExpandedFormOpen, - }" + class="w-full h-full text-sm border-none rounded-md py-1 outline-none focus:outline-none focus:ring-0" + :class="isExpandedFormOpen ? 'px-2' : 'px-0'" :placeholder="isEditColumn ? $t('labels.optional') : ''" @blur="submitCurrency" @keydown.down.stop diff --git a/packages/nc-gui/components/cell/Decimal.vue b/packages/nc-gui/components/cell/Decimal.vue index 32a619a2a3..8fc76956a6 100644 --- a/packages/nc-gui/components/cell/Decimal.vue +++ b/packages/nc-gui/components/cell/Decimal.vue @@ -94,10 +94,8 @@ watch(isExpandedFormOpen, () => { v-if="editEnabled" :ref="focus" v-model="vModel" - class="outline-none px-0 py-1 border-none rounded-md w-full h-full !text-sm" - :class="{ - '!px-2': isExpandedFormOpen, - }" + class="outline-none py-1 border-none rounded-md w-full h-full !text-sm" + :class="isExpandedFormOpen ? 'px-2' : 'px-0'" type="number" :step="precision" :placeholder="isEditColumn ? $t('labels.optional') : ''" diff --git a/packages/nc-gui/components/cell/Duration.vue b/packages/nc-gui/components/cell/Duration.vue index eae79f28a3..3905e3bea6 100644 --- a/packages/nc-gui/components/cell/Duration.vue +++ b/packages/nc-gui/components/cell/Duration.vue @@ -92,10 +92,8 @@ const focus: VNodeRef = (el) => !isExpandedFormOpen.value && !isEditColumn.value v-if="editEnabled" :ref="focus" v-model="localState" - class="w-full !border-none !outline-none px-0 py-1" - :class="{ - '!px-2': isExpandedFormOpen, - }" + class="w-full !border-none !outline-none py-1" + :class="isExpandedFormOpen ? 'px-2' : 'px-0'" :placeholder="durationPlaceholder" @blur="submitDuration" @keypress="checkDurationFormat($event)" diff --git a/packages/nc-gui/components/cell/Email.vue b/packages/nc-gui/components/cell/Email.vue index 42915c970d..088542563a 100644 --- a/packages/nc-gui/components/cell/Email.vue +++ b/packages/nc-gui/components/cell/Email.vue @@ -70,10 +70,8 @@ watch( v-if="editEnabled" :ref="focus" v-model="vModel" - class="w-full outline-none text-sm px-0 py-1" - :class="{ - '!px-2': isExpandedFormOpen, - }" + class="w-full outline-none text-sm py-1" + :class="isExpandedFormOpen ? 'px-2' : 'px-0'" :placeholder="isEditColumn ? $t('labels.optional') : ''" @blur="editEnabled = false" @keydown.down.stop diff --git a/packages/nc-gui/components/cell/Integer.vue b/packages/nc-gui/components/cell/Integer.vue index f1737067cc..9f27e38478 100644 --- a/packages/nc-gui/components/cell/Integer.vue +++ b/packages/nc-gui/components/cell/Integer.vue @@ -85,10 +85,8 @@ function onKeyDown(e: any) { v-if="editEnabled" :ref="focus" v-model="vModel" - class="outline-none px-0 py-1 border-none w-full h-full text-sm" - :class="{ - '!px-2': isExpandedFormOpen, - }" + class="outline-none py-1 border-none w-full h-full text-sm" + :class="isExpandedFormOpen ? 'px-2' : 'px-0'" type="number" style="letter-spacing: 0.06rem" :placeholder="isEditColumn ? $t('labels.optional') : ''" diff --git a/packages/nc-gui/components/cell/Percent.vue b/packages/nc-gui/components/cell/Percent.vue index 1d6a4e6d1a..c776bd3fc6 100644 --- a/packages/nc-gui/components/cell/Percent.vue +++ b/packages/nc-gui/components/cell/Percent.vue @@ -121,10 +121,8 @@ const onTabPress = (e: KeyboardEvent) => { v-if="editEnabled" :ref="focus" v-model="vModel" - class="w-full !text-sm !border-none !outline-none focus:ring-0 text-base px-0 py-1" - :class="{ - '!px-2': isExpandedFormOpen, - }" + class="w-full !text-sm !border-none !outline-none focus:ring-0 text-base py-1" + :class="isExpandedFormOpen ? 'px-2' : 'px-0'" type="number" :placeholder="isEditColumn ? $t('labels.optional') : ''" @blur="onBlur" diff --git a/packages/nc-gui/components/cell/PhoneNumber.vue b/packages/nc-gui/components/cell/PhoneNumber.vue index 5db583a2d2..46923aecdc 100644 --- a/packages/nc-gui/components/cell/PhoneNumber.vue +++ b/packages/nc-gui/components/cell/PhoneNumber.vue @@ -62,10 +62,8 @@ watch( v-if="editEnabled" :ref="focus" v-model="vModel" - class="w-full outline-none text-sm px-0 py-1" - :class="{ - '!px-2': isExpandedFormOpen, - }" + class="w-full outline-none text-sm py-1" + :class="isExpandedFormOpen ? 'px-2' : 'px-0'" :placeholder="isEditColumn ? $t('labels.optional') : ''" @blur="editEnabled = false" @keydown.down.stop diff --git a/packages/nc-gui/components/cell/RichText.vue b/packages/nc-gui/components/cell/RichText.vue index c562e934ec..67f26f28cb 100644 --- a/packages/nc-gui/components/cell/RichText.vue +++ b/packages/nc-gui/components/cell/RichText.vue @@ -156,7 +156,7 @@ watch(editorDom, () => {