diff --git a/src/app/_util/qrCode.ts b/src/app/_util/qrCode.ts index f2b92d5..9e95ff6 100644 --- a/src/app/_util/qrCode.ts +++ b/src/app/_util/qrCode.ts @@ -8,15 +8,11 @@ export const createQrCodeValue = ( delimiter = '-', barcodeType: string ): string => { - const is1D = barcodeType === 'code128'; - const locId = is1D ? locationId.slice(2, 4) : locationId; - const dateFormat = is1D ? 'yyMMdd' : 'yyyyMMddHHmm'; - const valArray = [ barCode, initials.toUpperCase(), - formatDate(dateCreated, dateFormat, 'en-us'), - locId, + formatDate(dateCreated, 'yyyyMMddHHmm', 'en-us'), + locationId, ]; return valArray.join(delimiter); }; diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 9b0d486..0fe3a4c 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -23,6 +23,7 @@ import {CountComponent} from './count/count.component'; import {FooterComponent} from './footer/footer.component'; import {CircleQRcodeDoubleComponent} from './label-layout/formats/circle-qrcode-double/circle-qrcode-double.component'; import {CircleQRcodeSingleComponent} from './label-layout/formats/circle-qrcode-single/circle-qrcode-single.component'; +import {Rectangle3x1Code128Component} from './label-layout/formats/rectangle-3x1-code128/rectangle-3x1-code128.component'; import {RectangleCode128Component} from './label-layout/formats/rectangle-code128/rectangle-code128.component'; import {RectangleDatamatrixComponent} from './label-layout/formats/rectangle-datamatrix/rectangle-datamatrix.component'; import {LabelLayoutComponent} from './label-layout/label-layout.component'; @@ -64,6 +65,7 @@ export function getBaseHref(platformLocation: PlatformLocation): string { NavbarComponent, PrintComponent, PrintLayoutComponent, + Rectangle3x1Code128Component, RectangleCode128Component, RectangleDatamatrixComponent, SampleComponent, diff --git a/src/app/config/defaults.ts b/src/app/config/defaults.ts index d5b786d..b55efd1 100644 --- a/src/app/config/defaults.ts +++ b/src/app/config/defaults.ts @@ -16,6 +16,14 @@ export const labelLayouts = { pageWidth: 64, pageHeight: 32, }), + rectangle_3x1_code128: new LabelLayout({ + name: '3in x 1in Rectangular Label - CODE128', + barcodeType: 'code128', + id: 'rectangle_3x1_code128', + pageWidth: 78.2, + pageHeight: 26.4, + delimiter: '', + }), rectangle_code128: new LabelLayout({ name: '2in x 1.25in Rectangular Label - CODE128', barcodeType: 'code128', diff --git a/src/app/label-layout/formats/rectangle-3x1-code128/rectangle-3x1-code128.component.scss b/src/app/label-layout/formats/rectangle-3x1-code128/rectangle-3x1-code128.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/label-layout/formats/rectangle-3x1-code128/rectangle-3x1-code128.component.spec.ts b/src/app/label-layout/formats/rectangle-3x1-code128/rectangle-3x1-code128.component.spec.ts new file mode 100644 index 0000000..ed1cc97 --- /dev/null +++ b/src/app/label-layout/formats/rectangle-3x1-code128/rectangle-3x1-code128.component.spec.ts @@ -0,0 +1,27 @@ +import {ComponentFixture, TestBed} from '@angular/core/testing'; +import {mockSample} from '../../../testing/sample.mock'; + +import {Rectangle3x1Code128Component} from './rectangle-3x1-code128.component'; + +describe('Rectangle3x1Code128Component', () => { + let component: Rectangle3x1Code128Component; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [Rectangle3x1Code128Component] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(Rectangle3x1Code128Component); + component = fixture.componentInstance; + component.sample = mockSample; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/label-layout/formats/rectangle-3x1-code128/rectangle-3x1-code128.component.svg b/src/app/label-layout/formats/rectangle-3x1-code128/rectangle-3x1-code128.component.svg new file mode 100644 index 0000000..69db68d --- /dev/null +++ b/src/app/label-layout/formats/rectangle-3x1-code128/rectangle-3x1-code128.component.svg @@ -0,0 +1,45 @@ + + + + + + + + + UP + + + + + + + + + + + {{sample.barcode}} + diff --git a/src/app/label-layout/formats/rectangle-3x1-code128/rectangle-3x1-code128.component.ts b/src/app/label-layout/formats/rectangle-3x1-code128/rectangle-3x1-code128.component.ts new file mode 100644 index 0000000..581b409 --- /dev/null +++ b/src/app/label-layout/formats/rectangle-3x1-code128/rectangle-3x1-code128.component.ts @@ -0,0 +1,25 @@ +import {Component, Input, OnInit} from '@angular/core'; +import {AppDefaults} from '../../../models/appDefaults.interface'; +import {Sample} from '../../../models/sample.interface'; + +@Component({ + selector: 'app-rectangle-3x1-code128', + templateUrl: './rectangle-3x1-code128.component.svg', + styleUrls: ['./rectangle-3x1-code128.component.scss'] +}) +export class Rectangle3x1Code128Component implements OnInit { + @Input() sample: Sample; + @Input() settings: AppDefaults; + @Input() x: number; + @Input() y: number; + @Input() width: number; + @Input() height: number; + + constructor() { } + + ngOnInit(): void { + // Replace "#barcode" element with svg of barcode + + } + +} diff --git a/src/app/label-layout/label-layout.component.html b/src/app/label-layout/label-layout.component.html index b12666f..1543f64 100644 --- a/src/app/label-layout/label-layout.component.html +++ b/src/app/label-layout/label-layout.component.html @@ -1,4 +1,5 @@ + diff --git a/src/app/settings/settings.component.html b/src/app/settings/settings.component.html index 40a1bc4..b21615e 100644 --- a/src/app/settings/settings.component.html +++ b/src/app/settings/settings.component.html @@ -41,6 +41,7 @@
+