Merged PR 2048: fix(shared-barcode, crm-customer-card): improve barcode rendering with transp...

fix(shared-barcode, crm-customer-card): improve barcode rendering with transparent SVG background

Enhance barcode component flexibility by separating container and SVG
background colors. The SVG barcode now defaults to transparent background
while maintaining container background control, enabling better integration
with various card designs.

Changes:
- Add separate svgBackground input for SVG element (default: transparent)
- Keep background input for container styling (default: #ffffff)
- Add containerWidth and containerHeight inputs for flexible sizing
- Update customer card to remove explicit white background on barcode
- Add opacity styling for inactive customer cards
- Enhance test coverage for new background and sizing inputs

The separation of concerns allows the barcode to adapt to parent container
backgrounds while maintaining consistent rendering across different contexts.

Ref: #5498
This commit is contained in:
Nino Righi
2025-11-24 14:58:05 +00:00
committed by Lorenz Hilpert
parent 949101a1ed
commit 8b852cbd7a
5 changed files with 151 additions and 34 deletions

View File

@@ -1,6 +1,7 @@
<!-- Card container: 337×213px, rounded-2xl, shadow -->
<div
class="relative flex h-[14.8125rem] w-[21.0625rem] flex-col bg-isa-black"
class="relative flex h-[14.8125rem] w-[21.0625rem] flex-col"
[class.opacity-40]="!card().isActive"
[attr.data-what]="'customer-card'"
[attr.data-which]="card().code"
>
@@ -11,13 +12,11 @@
<div>
<!-- Card type label (grey) -->
<div class="isa-text-body-2-bold text-center text-isa-neutral-500">
{{ card().isPrimary ? 'Kundenkarte Nr.:' : 'Mitarbeitendenkarte Nr.:' }}
Kundenkarte Nr.:
</div>
<!-- Card number (white, large) -->
<div
class="isa-text-subtitle-1-bold w-[150px] text-center text-isa-white"
>
<div class="isa-text-subtitle-1-bold text-center text-isa-white">
{{ card().code }}
</div>
</div>
@@ -30,7 +29,6 @@
[width]="barcodeWidth"
[margin]="barcodeMargin"
[format]="'CODE128'"
[background]="'#ffffff'"
[attr.data-what]="'card-barcode'"
[attr.data-which]="card().code"
class="rounded-[0.25rem] overflow-hidden"