mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-30 11:26:38 +00:00
feat: Barcode row height support
Signed-off-by: mertmit <mertmit99@gmail.com>
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import JsBarcodeWrapper from './JsBarcodeWrapper.vue'
|
||||
import { ComputedRef } from 'vue'
|
||||
import { GridType } from 'nocodb-sdk'
|
||||
import { ActiveViewInj } from '#imports'
|
||||
|
||||
const maxNumberOfAllowedCharsForBarcodeValue = 100
|
||||
|
||||
const view = inject(ActiveViewInj, ref())
|
||||
|
||||
const cellValue = inject(CellValueInj)
|
||||
|
||||
const column = inject(ColumnInj)
|
||||
@@ -29,6 +34,22 @@ const handleModalOkClick = () => (modalVisible.value = false)
|
||||
const showBarcode = computed(() => barcodeValue?.value.length > 0 && !tooManyCharsForBarcode.value)
|
||||
|
||||
const { showEditNonEditableFieldWarning, showClearNonEditableFieldWarning } = useShowNotEditableWarning()
|
||||
|
||||
|
||||
const rowHeight = computed(() => {
|
||||
if ((view.value?.view as GridType)?.row_height !== undefined) {
|
||||
switch ((view.value?.view as GridType)?.row_height) {
|
||||
case 0:
|
||||
return 1
|
||||
case 1:
|
||||
return 2
|
||||
case 2:
|
||||
return 4
|
||||
case 3:
|
||||
return 6
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -46,6 +67,7 @@ const { showEditNonEditableFieldWarning, showClearNonEditableFieldWarning } = us
|
||||
v-if="showBarcode"
|
||||
:barcode-value="barcodeValue"
|
||||
:barcode-format="barcodeMeta.barcodeFormat"
|
||||
:custom-style="{ height: rowHeight ? `${rowHeight * 1.4}rem` : `1.4rem` }"
|
||||
@on-click-barcode="showBarcodeModal"
|
||||
>
|
||||
<template #barcodeRenderError>
|
||||
|
||||
Reference in New Issue
Block a user