Browse Source

fix: borcode and qrcode center alignment issue #7253

pull/7270/head
Ramesh Mane 9 months ago
parent
commit
7d7b80875c
  1. 17
      packages/nc-gui/components/virtual-cell/QrCode.vue
  2. 6
      packages/nc-gui/components/virtual-cell/barcode/Barcode.vue

17
packages/nc-gui/components/virtual-cell/QrCode.vue

@ -77,25 +77,26 @@ const { showEditNonEditableFieldWarning, showClearNonEditableFieldWarning } = us
</template> </template>
<img v-if="showQrCode" :src="qrCodeLarge" :alt="$t('title.qrCode')" /> <img v-if="showQrCode" :src="qrCodeLarge" :alt="$t('title.qrCode')" />
</a-modal> </a-modal>
<div v-if="tooManyCharsForQrCode" class="text-left text-wrap mt-2 text-[#e65100] text-[10px]">
{{ $t('labels.qrCodeValueTooLong') }}
</div>
<div <div
class="pl-2 w-full flex" v-if="showQrCode"
class="w-full flex"
:class="{ :class="{
'flex-start': isExpandedFormOpen, 'flex-start pl-2': isExpandedFormOpen,
'justify-center': !isExpandedFormOpen, 'justify-center': !isExpandedFormOpen,
}" }"
> >
<img <img
v-if="showQrCode && rowHeight" v-if="rowHeight"
:style="{ height: rowHeight ? `${rowHeight * 1.4}rem` : `1.4rem` }" :style="{ height: rowHeight ? `${rowHeight * 1.8}rem` : `1.8rem` }"
:src="qrCode" :src="qrCode"
:alt="$t('title.qrCode')" :alt="$t('title.qrCode')"
class="min-w-[1.4em]" class="min-w-[1.4em]"
@click="showQrModal" @click="showQrModal"
/> />
<img v-else-if="showQrCode" class="mx-auto min-w-[1.4em]" :src="qrCode" :alt="$t('title.qrCode')" @click="showQrModal" /> <img v-else class="mx-auto min-w-[1.4em]" :src="qrCode" :alt="$t('title.qrCode')" @click="showQrModal" />
</div>
<div v-if="tooManyCharsForQrCode" class="text-left text-wrap mt-2 text-[#e65100] text-xs">
{{ $t('labels.qrCodeValueTooLong') }}
</div> </div>
<div v-if="showEditNonEditableFieldWarning" class="text-left text-wrap mt-2 text-[#e65100] text-xs"> <div v-if="showEditNonEditableFieldWarning" class="text-left text-wrap mt-2 text-[#e65100] text-xs">
{{ $t('msg.warning.nonEditableFields.computedFieldUnableToClear') }} {{ $t('msg.warning.nonEditableFields.computedFieldUnableToClear') }}

6
packages/nc-gui/components/virtual-cell/barcode/Barcode.vue

@ -55,9 +55,9 @@ const rowHeight = inject(RowHeightInj, ref(undefined))
</a-modal> </a-modal>
<div <div
v-if="!tooManyCharsForBarcode" v-if="!tooManyCharsForBarcode"
class="flex ml-2 w-full items-center barcode-wrapper" class="flex w-full items-center barcode-wrapper"
:class="{ :class="{
'justify-start': isExpandedFormOpen, 'justify-start ml-2': isExpandedFormOpen,
'justify-center': !isExpandedFormOpen, 'justify-center': !isExpandedFormOpen,
}" }"
> >
@ -65,7 +65,7 @@ const rowHeight = inject(RowHeightInj, ref(undefined))
v-if="showBarcode && rowHeight" v-if="showBarcode && rowHeight"
:barcode-value="barcodeValue" :barcode-value="barcodeValue"
:barcode-format="barcodeMeta.barcodeFormat" :barcode-format="barcodeMeta.barcodeFormat"
:custom-style="{ height: rowHeight ? `${rowHeight * 1.4}rem` : `1.4rem` }" :custom-style="{ height: rowHeight ? `${rowHeight * 1.8}rem` : `1.8rem` }"
@on-click-barcode="showBarcodeModal" @on-click-barcode="showBarcodeModal"
> >
<template #barcodeRenderError> <template #barcodeRenderError>

Loading…
Cancel
Save