|
|
@ -15,6 +15,8 @@ const tooManyCharsForBarcode = computed(() => barcodeValue.value.length > maxNum |
|
|
|
|
|
|
|
|
|
|
|
const modalVisible = ref(false) |
|
|
|
const modalVisible = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isExpandedFormOpen = inject(IsExpandedFormOpenInj, ref(false)) |
|
|
|
|
|
|
|
|
|
|
|
const showBarcodeModal = () => { |
|
|
|
const showBarcodeModal = () => { |
|
|
|
modalVisible.value = true |
|
|
|
modalVisible.value = true |
|
|
|
} |
|
|
|
} |
|
|
@ -46,31 +48,39 @@ const rowHeight = inject(RowHeightInj, ref(undefined)) |
|
|
|
> |
|
|
|
> |
|
|
|
<JsBarcodeWrapper v-if="showBarcode" :barcode-value="barcodeValue" :barcode-format="barcodeMeta.barcodeFormat" /> |
|
|
|
<JsBarcodeWrapper v-if="showBarcode" :barcode-value="barcodeValue" :barcode-format="barcodeMeta.barcodeFormat" /> |
|
|
|
</a-modal> |
|
|
|
</a-modal> |
|
|
|
<JsBarcodeWrapper |
|
|
|
<div |
|
|
|
v-if="showBarcode && rowHeight" |
|
|
|
class="flex ml-2 w-full items-center" |
|
|
|
:barcode-value="barcodeValue" |
|
|
|
:class="{ |
|
|
|
:barcode-format="barcodeMeta.barcodeFormat" |
|
|
|
'justify-start': isExpandedFormOpen, |
|
|
|
:custom-style="{ height: rowHeight ? `${rowHeight * 1.4}rem` : `1.4rem` }" |
|
|
|
'justify-center': !isExpandedFormOpen, |
|
|
|
@on-click-barcode="showBarcodeModal" |
|
|
|
}" |
|
|
|
> |
|
|
|
|
|
|
|
<template #barcodeRenderError> |
|
|
|
|
|
|
|
<div class="text-left text-wrap mt-2 text-[#e65100] text-xs" data-testid="barcode-invalid-input-message"> |
|
|
|
|
|
|
|
{{ $t('msg.warning.barcode.renderError') }} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</JsBarcodeWrapper> |
|
|
|
|
|
|
|
<JsBarcodeWrapper |
|
|
|
|
|
|
|
v-else-if="showBarcode" |
|
|
|
|
|
|
|
:barcode-value="barcodeValue" |
|
|
|
|
|
|
|
:barcode-format="barcodeMeta.barcodeFormat" |
|
|
|
|
|
|
|
@on-click-barcode="showBarcodeModal" |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
<template #barcodeRenderError> |
|
|
|
<JsBarcodeWrapper |
|
|
|
<div class="text-left text-wrap mt-2 text-[#e65100] text-xs" data-testid="barcode-invalid-input-message"> |
|
|
|
v-if="showBarcode && rowHeight" |
|
|
|
{{ $t('msg.warning.barcode.renderError') }} |
|
|
|
:barcode-value="barcodeValue" |
|
|
|
</div> |
|
|
|
:barcode-format="barcodeMeta.barcodeFormat" |
|
|
|
</template> |
|
|
|
:custom-style="{ height: rowHeight ? `${rowHeight * 1.4}rem` : `1.4rem`, width: 40 }" |
|
|
|
</JsBarcodeWrapper> |
|
|
|
@on-click-barcode="showBarcodeModal" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<template #barcodeRenderError> |
|
|
|
|
|
|
|
<div class="text-left text-wrap mt-2 text-[#e65100] text-xs" data-testid="barcode-invalid-input-message"> |
|
|
|
|
|
|
|
{{ $t('msg.warning.barcode.renderError') }} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</JsBarcodeWrapper> |
|
|
|
|
|
|
|
<JsBarcodeWrapper |
|
|
|
|
|
|
|
v-else-if="showBarcode" |
|
|
|
|
|
|
|
:barcode-value="barcodeValue" |
|
|
|
|
|
|
|
:barcode-format="barcodeMeta.barcodeFormat" |
|
|
|
|
|
|
|
@on-click-barcode="showBarcodeModal" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<template #barcodeRenderError> |
|
|
|
|
|
|
|
<div class="text-left text-wrap mt-2 text-[#e65100] text-xs" data-testid="barcode-invalid-input-message"> |
|
|
|
|
|
|
|
{{ $t('msg.warning.barcode.renderError') }} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</JsBarcodeWrapper> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div v-if="tooManyCharsForBarcode" class="text-left text-wrap mt-2 text-[#e65100] text-xs"> |
|
|
|
<div v-if="tooManyCharsForBarcode" class="text-left text-wrap mt-2 text-[#e65100] text-xs"> |
|
|
|
{{ $t('labels.barcodeValueTooLong') }} |
|
|
|
{{ $t('labels.barcodeValueTooLong') }} |
|
|
|